Code

git-mv: follow -k request even on failing renames
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Sun, 27 Nov 2005 21:11:33 +0000 (22:11 +0100)
committerJunio C Hamano <junkio@cox.net>
Sun, 27 Nov 2005 22:40:29 +0000 (14:40 -0800)
-k requests to keep running on an error condition.
Previously, git-mv stopped on failing renames even with -k.

There are some error conditions which are not checked in the
first phase of git-mv, eg. 'permission denied'. Still, option
-k should work.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-mv.perl

index 8d294d6529f158f65d318fc1c41fd27476639e8b..65b1dcfdf2314e2eb8b7bfd1124210ad73269b10 100755 (executable)
@@ -151,6 +151,11 @@ while(scalar @srcs > 0) {
     if (!$opt_n) {
        if (!rename($src,$dst)) {
            $bad = "renaming '$src' failed: $!";
+           if ($opt_k) {
+               print "Warning: skipped: $bad\n";
+               $bad = "";
+               next;
+           }
            last;
        }
     }