Browse Source

Allow git-mv to accept ./ in paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>
maint
Junio C Hamano 19 years ago
parent
commit
9a0e6731c6
  1. 9
      git-mv.perl

9
git-mv.perl

@ -75,6 +75,15 @@ while(scalar @srcArgs > 0) { @@ -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";
}

Loading…
Cancel
Save