X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-mv.perl;h=53046bafd66ebc4c3a7ef5c65a6363ef5201dcdd;hb=3e9fabc85ef44fa0f275dd89738a2dacb7b6f5db;hp=ac19876fecbd2758e2782ae3f3423a727a036bd3;hpb=f6bc189a457b2575587f26e27f1eabdd615b2d78;p=git.git diff --git a/git-mv.perl b/git-mv.perl index ac19876f..53046baf 100755 --- a/git-mv.perl +++ b/git-mv.perl @@ -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; } }