Don't clobber existing .git; reset after import
This commit is contained in:
parent
2fa13ce3cd
commit
1933c5e38d
5
wp2git.d
5
wp2git.d
|
@ -45,9 +45,12 @@ int main(string[] args)
|
||||||
}
|
}
|
||||||
write("fast-import-data", data);
|
write("fast-import-data", data);
|
||||||
|
|
||||||
if (!exists(".git"))
|
if (exists(".git"))
|
||||||
|
throw new Exception("A git repository already exists here!");
|
||||||
|
|
||||||
system("git init");
|
system("git init");
|
||||||
system("git fast-import --date-format=rfc2822 < fast-import-data");
|
system("git fast-import --date-format=rfc2822 < fast-import-data");
|
||||||
|
system("git reset --hard");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue