Browse Source

git-mv: fully detect 'directory moved into itself'

This gives a better error message when trying to move a directory
into some subdirectory of itself; ie. no real bug fix: renaming
already failed before, but with a strange "invalid argument".

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Josef Weidendorfer 19 years ago committed by Junio C Hamano
parent
commit
ca203ee7db
  1. 2
      git-mv.perl

2
git-mv.perl

@ -108,7 +108,7 @@ while(scalar @srcArgs > 0) { @@ -108,7 +108,7 @@ while(scalar @srcArgs > 0) {
}
}
if (($bad eq "") && ($src eq $dstDir)) {
if (($bad eq "") && ($dst =~ /^$src\//)) {
$bad = "can not move directory '$src' into itself";
}


Loading…
Cancel
Save