git-svn: remove files from the index before adding/updating
This fixes a bug when importing where a directory gets removed/renamed but is immediately replaced by a file of the same name in the same revision. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Feb 17, 2006 at 21:04 UTC
0870321548806e85fbf1433a6e016fa3cc09d524
1 file changed
+5
-6
contrib/git-svn/git-svn
+5
-6
@@ -580,13 +580,12 @@ sub svn_info {
580
sub sys { system(@_) == 0 or croak $? }
581
582
sub git_addremove {
583
- system( "git-ls-files -z --others ".
583
+ system( "git-diff-files --name-only -z ".
584
+ " | git-update-index --remove -z --stdin; ".
585
+ "git-ls-files -z --others ".
586
"'--exclude-from=$GIT_DIR/$GIT_SVN/info/exclude'".
585
- "| git-update-index --add -z --stdin; ".
586
- "git-ls-files -z --deleted ".
587
- "| git-update-index --remove -z --stdin; ".
588
- "git-ls-files -z --modified".
589
- "| git-update-index -z --stdin") == 0 or croak $?
587
+ " | git-update-index --add -z --stdin; "
588
+ ) == 0 or croak $?
589
}
590
591
sub s_to_file {