Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2005-11-02 01:46:27 +0300
committerJunio C Hamano <junkio@cox.net>2005-11-02 01:45:49 +0300
commitf676fa76e26faed3ac02a9dae8f9f7addb9542a4 (patch)
treeb71d7b211ffed2a39de29d772be1d40dde2951a9 /git-mv.perl
parent085c1e2212e1adef2e8c72a28641bc4a8314a4e6 (diff)
Strip any trailing slash on destination argument
Needed because generating a target paths will add another slash. This fixes e.g. "git-mv file dir/", which removed "file" from version control by renaming it to "dir//file", as git-update-index does not accept such paths. Thanks goes to Ben Lau for noting this bug. Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-mv.perl')
-rwxr-xr-xgit-mv.perl2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-mv.perl b/git-mv.perl
index 17e35b0ac0..a21d87eea8 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -54,6 +54,8 @@ my ($src, $dst, $base, $dstDir);
my $argCount = scalar @ARGV;
if (-d $ARGV[$argCount-1]) {
$dstDir = $ARGV[$argCount-1];
+ # remove any trailing slash
+ $dstDir =~ s/\/$//;
@srcArgs = @ARGV[0..$argCount-2];
foreach $src (@srcArgs) {