X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-mv.perl;fp=git-mv.perl;h=2ea852c9185743d5b84523698cbffaaffb238543;hb=573464319f70bd54a7c48cfd7bed6a0f6f331f42;hp=83dc7e45cf205c7575512182bf29516914773209;hpb=feffaddce0cec7fd3f749d23e95579b683961002;p=git.git diff --git a/git-mv.perl b/git-mv.perl index 83dc7e45..2ea852c9 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"; }