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 8d294d6..65b1dcf 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;
        }
     }