From: Junio C Hamano Date: Sun, 19 Feb 2006 07:42:03 +0000 (-0800) Subject: Allow git-mv to accept ./ in paths. X-Git-Tag: v1.3.0-rc1~190^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9a0e6731c632c841cd2de9dec0b9091b2f10c6fd;p=git.git Allow git-mv to accept ./ in paths. Signed-off-by: Junio C Hamano --- diff --git a/git-mv.perl b/git-mv.perl index 83dc7e45c..2ea852c91 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"; }