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>
This commit is contained in:
parent
8aa10d4a5b
commit
e0976dcf83
@ -209,7 +209,9 @@ EOF
|
|||||||
delete($ENV{GIT_INDEX_FILE});
|
delete($ENV{GIT_INDEX_FILE});
|
||||||
|
|
||||||
# Changes in the working tree need special treatment since they are
|
# 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) {
|
for my $file (@working_tree) {
|
||||||
my $dir = dirname($file);
|
my $dir = dirname($file);
|
||||||
unless (-d "$rdir/$dir") {
|
unless (-d "$rdir/$dir") {
|
||||||
|
Loading…
Reference in New Issue
Block a user