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>
This commit is contained in:
parent
f6bc189a45
commit
ca203ee7db
@ -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…
Reference in New Issue
Block a user