Josef Weidendorfer  committed f676fa7

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 <>

  • Participants
  • Parent commits 085c1e2

Comments (0)

Files changed (1)

 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) {