Skip to content

Commit

Permalink
Allow git-mv to accept ./ in paths.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9a0e673 commit)
  • Loading branch information
Junio C Hamano committed Mar 1, 2006
1 parent feffadd commit 5734643
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions git-mv.perl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ ()
$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";
}
Expand Down

0 comments on commit 5734643

Please sign in to comment.