1
0
mirror of https://github.com/git/git.git synced 2024-11-18 05:13:58 +01:00

Allow git-mv to accept ./ in paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9a0e6731c632c841cd2de9dec0b9091b2f10c6fd commit)
This commit is contained in:
Junio C Hamano 2006-02-18 23:42:03 -08:00
parent feffaddce0
commit 573464319f

@ -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";
}