mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
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 @@ ()
|
|||
}
|
||||
}
|
||||
|
||||
if (($bad eq "") && ($src eq $dstDir)) {
|
||||
if (($bad eq "") && ($dst =~ /^$src\//)) {
|
||||
$bad = "can not move directory '$src' into itself";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue