summaryrefslogtreecommitdiffstats
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-18 22:03:41 +0100
committerJunio C Hamano <gitster@pobox.com>2014-03-18 22:03:41 +0100
commita5aca6e883639ce3a3ad07271032905edc0ac608 (patch)
treed668c311a147fc10e2c83b96c01506938fc02930 /diff.c
parentMerge branch 'nd/reset-setup-worktree' into maint (diff)
parentdiff: do not reuse_worktree_file for submodules (diff)
downloadgit-a5aca6e883639ce3a3ad07271032905edc0ac608.tar.xz
git-a5aca6e883639ce3a3ad07271032905edc0ac608.zip
Merge branch 'tr/diff-submodule-no-reuse-worktree' into maint
"git diff --external-diff" incorrectly fed the submodule directory in the working tree to the external diff driver when it knew it is the same as one of the versions being compared. * tr/diff-submodule-no-reuse-worktree: diff: do not reuse_worktree_file for submodules
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index e8006666d8..1cd4672d03 100644
--- a/diff.c
+++ b/diff.c
@@ -2845,8 +2845,9 @@ static struct diff_tempfile *prepare_temp_file(const char *name,
remove_tempfile_installed = 1;
}
- if (!one->sha1_valid ||
- reuse_worktree_file(name, one->sha1, 1)) {
+ if (!S_ISGITLINK(one->mode) &&
+ (!one->sha1_valid ||
+ reuse_worktree_file(name, one->sha1, 1))) {
struct stat st;
if (lstat(name, &st) < 0) {
if (errno == ENOENT)