@matheusbsbs / matheus-bagliano / commits / 9a0e6731c6
Fork 0

Allow git-mv to accept ./ in paths.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 18, 2006 at 23:42 UTC 9a0e6731c632c841cd2de9dec0b9091b2f10c6fd
1 file changed +9
git-mv.perl
+9
@@ -75,6 +75,15 @@ while(scalar @srcArgs > 0) {
75 $dst = shift @dstArgs;
76 $bad = "";
77
78 + for ($src, $dst) {
79 + # Be nicer to end-users by doing ".//a/./b/.//./c" ==> "a/b/c"
80 + s|^\./||;
81 + s|/\./|/| while (m|/\./|);
82 + s|//+|/|g;
83 + # Also "a/b/../c" ==> "a/c"
84 + 1 while (s,(^|/)[^/]+/\.\./,$1,);
85 + }
86 +
87 if ($opt_v) {
88 print "Checking rename of '$src' to '$dst'\n";
89 }