http-push cleanup
[git.git] / git-mv.perl
index ac19876..53046ba 100755 (executable)
@@ -108,7 +108,7 @@ while(scalar @srcArgs > 0) {
        }
     }
     
-    if (($bad eq "") && ($src eq $dstDir)) {
+    if (($bad eq "") && ($dst =~ /^$safesrc\//)) {
        $bad = "can not move directory '$src' into itself";
     }
 
@@ -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;
        }
     }