X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-mv.perl;h=fe9c40e1b9ed81f0494bf2c20239c6a5d5b76d30;hb=d5dddccaa0c61c67340efca36237dfa06eccef1c;hp=f3e859ae48af05d0b982a159c2197bab7e5da996;hpb=9e7c73de0bcd410d12f897b19419dd35accd961e;p=git.git diff --git a/git-mv.perl b/git-mv.perl index f3e859ae..fe9c40e1 100755 --- a/git-mv.perl +++ b/git-mv.perl @@ -90,6 +90,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"; }