Don't clobber existing .git; reset after import

This commit is contained in:
Vladimir Panteleev 2010-06-16 02:09:52 +03:00
parent 2fa13ce3cd
commit 1933c5e38d
1 changed files with 5 additions and 2 deletions

View File

@ -45,9 +45,12 @@ int main(string[] args)
}
write("fast-import-data", data);
if (!exists(".git"))
system("git init");
if (exists(".git"))
throw new Exception("A git repository already exists here!");
system("git init");
system("git fast-import --date-format=rfc2822 < fast-import-data");
system("git reset --hard");
return 0;
}