提交 f676fa76 编写于 作者: J Josef Weidendorfer 提交者: Junio C Hamano

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: NJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 085c1e22
......@@ -54,6 +54,8 @@ ()
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册