From: Josef Weidendorfer Date: Tue, 1 Nov 2005 22:46:27 +0000 (+0100) Subject: Strip any trailing slash on destination argument X-Git-Tag: v0.99.9b^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f676fa76e26faed3ac02a9dae8f9f7addb9542a4;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/git-mv.perl b/git-mv.perl index 17e35b0a..a21d87ee 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) {