summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2005-11-27 21:06:42 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-27 22:40:29 (GMT)
commitca203ee7db708baa278950501f8d01f29c5190be (patch)
tree5b67c88670a5872520b05d5e2b1fd7fb586e99a1
parentf6bc189a457b2575587f26e27f1eabdd615b2d78 (diff)
downloadgit-ca203ee7db708baa278950501f8d01f29c5190be.zip
git-ca203ee7db708baa278950501f8d01f29c5190be.tar.gz
git-ca203ee7db708baa278950501f8d01f29c5190be.tar.bz2
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>
-rwxr-xr-xgit-mv.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-mv.perl b/git-mv.perl
index ac19876..8d294d6 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 =~ /^$src\//)) {
$bad = "can not move directory '$src' into itself";
}