@matheusbsbs / matheus-bagliano / commits / ca203ee7db
Fork 0

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>

Josef Weidendorfer committed Nov 27, 2005 at 22:06 UTC ca203ee7db708baa278950501f8d01f29c5190be
1 file changed +1 -1
git-mv.perl
+1 -1
@@ -108,7 +108,7 @@ while(scalar @srcArgs > 0) {
108 }
109 }
110
111 - if (($bad eq "") && ($src eq $dstDir)) {
111 + if (($bad eq "") && ($dst =~ /^$src\//)) {
112 $bad = "can not move directory '$src' into itself";
113 }
114