From: John Keeping Date: Thu, 14 Mar 2013 20:19:40 +0000 (+0000) Subject: difftool: avoid double slashes in symlink targets X-Git-Tag: v1.8.3-rc0~160^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e0976dcf83884fd0b48e90f0c62f50852e6971f6?ds=sidebyside;hp=8aa10d4a5bb2eceb78b689f0c13b334725a1019f difftool: avoid double slashes in symlink targets When we add tests for symlinks in "git difftool --dir-diff" it's easier to check the target path if we don't have to worry about double slashes separating directories. Remove the trailing slash (if present) from $workdir before creating the symlinks in order to avoid this. Signed-off-by: John Keeping Signed-off-by: Junio C Hamano --- diff --git a/git-difftool.perl b/git-difftool.perl index 0a90de4146..3cab257595 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -209,7 +209,9 @@ sub setup_dir_diff delete($ENV{GIT_INDEX_FILE}); # Changes in the working tree need special treatment since they are - # not part of the index + # not part of the index. Remove any trailing slash from $workdir + # before starting to avoid double slashes in symlink targets. + $workdir =~ s|/$||; for my $file (@working_tree) { my $dir = dirname($file); unless (-d "$rdir/$dir") {