mirror of
https://github.com/git/git
synced 2024-08-26 19:19:18 +00:00
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>
This commit is contained in:
parent
085c1e2212
commit
f676fa76e2
|
@ -54,6 +54,8 @@ ()
|
||||||
my $argCount = scalar @ARGV;
|
my $argCount = scalar @ARGV;
|
||||||
if (-d $ARGV[$argCount-1]) {
|
if (-d $ARGV[$argCount-1]) {
|
||||||
$dstDir = $ARGV[$argCount-1];
|
$dstDir = $ARGV[$argCount-1];
|
||||||
|
# remove any trailing slash
|
||||||
|
$dstDir =~ s/\/$//;
|
||||||
@srcArgs = @ARGV[0..$argCount-2];
|
@srcArgs = @ARGV[0..$argCount-2];
|
||||||
|
|
||||||
foreach $src (@srcArgs) {
|
foreach $src (@srcArgs) {
|
||||||
|
|
Loading…
Reference in a new issue