Merge branch 'jk/difftool-in-subdir' into maint
[gitweb.git] / git-difftool.perl
index 4e4f5d8138a68e52e5ec0b787c1d7a09ba3e6658..e26294feab988d1bfc15d10acbe2774b29b5ec6f 100755 (executable)
@@ -188,6 +188,10 @@ sub setup_dir_diff
                }
        }
 
+       # Go to the root of the worktree so that the left index files
+       # are properly setup -- the index is toplevel-relative.
+       chdir($worktree);
+
        # Setup temp directories
        my $tmpdir = tempdir('git-difftool.XXXXX', CLEANUP => 0, TMPDIR => 1);
        my $ldir = "$tmpdir/left";