summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-19 21:17:59 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-19 21:17:59 -0800
commit1561a9b662bb4721e01654c44854efffa005169e (patch)
tree680e16a6b94738cc2ded4536f5397ed56f46857b
parent5102349cc075e5452c4a438194aa433599f419bb (diff)
parent9a0e6731c632c841cd2de9dec0b9091b2f10c6fd (diff)
downloadgit-1561a9b662bb4721e01654c44854efffa005169e.tar.gz
Merge branch 'jc/mv'
* jc/mv: Allow git-mv to accept ./ in paths.
-rwxr-xr-xgit-mv.perl9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-mv.perl b/git-mv.perl
index 83dc7e45cf..2ea852c918 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -75,6 +75,15 @@ while(scalar @srcArgs > 0) {
$dst = shift @dstArgs;
$bad = "";
+ for ($src, $dst) {
+ # Be nicer to end-users by doing ".//a/./b/.//./c" ==> "a/b/c"
+ s|^\./||;
+ s|/\./|/| while (m|/\./|);
+ s|//+|/|g;
+ # Also "a/b/../c" ==> "a/c"
+ 1 while (s,(^|/)[^/]+/\.\./,$1,);
+ }
+
if ($opt_v) {
print "Checking rename of '$src' to '$dst'\n";
}