Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2013-03-15 00:19:40 +0400
committerJunio C Hamano <gitster@pobox.com>2013-03-15 01:29:05 +0400
commite0976dcf83884fd0b48e90f0c62f50852e6971f6 (patch)
treeb46d2436505015c1a87b94206891a4b2c0ee1eec /git-difftool.perl
parent8aa10d4a5bb2eceb78b689f0c13b334725a1019f (diff)
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 <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-difftool.perl')
-rwxr-xr-xgit-difftool.perl4
1 files changed, 3 insertions, 1 deletions
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 @@ EOF
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") {