aboutsummaryrefslogtreecommitdiff
path: root/git-mv.perl
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-18 23:42:03 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-18 23:42:03 -0800
commit9a0e6731c632c841cd2de9dec0b9091b2f10c6fd (patch)
treeba578e5fd32c8859741772a7ff92f1a4c9f0a0bb /git-mv.perl
parent709a9e5771ddb32995df6a0622e5d643baa4487a (diff)
downloadgit-9a0e6731c632c841cd2de9dec0b9091b2f10c6fd.tar.gz
git-9a0e6731c632c841cd2de9dec0b9091b2f10c6fd.tar.xz
Allow git-mv to accept ./ in paths.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-mv.perl')
-rwxr-xr-xgit-mv.perl9
1 files changed, 9 insertions, 0 deletions
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";
}