summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-14 21:25:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-03-14 21:25:20 (GMT)
commit481e6aaaccbef810f6c43cfd46058cff36cb1c66 (patch)
tree8b7d1324dcdc0944b46ac8f3c35c166e6a2796b0 /diff.c
parent6eb593a764303c05c7ca4f0fd107c5118b9cf7fb (diff)
parentaba4727281612c3e24914691727e11e1f44a9aac (diff)
downloadgit-481e6aaaccbef810f6c43cfd46058cff36cb1c66.zip
git-481e6aaaccbef810f6c43cfd46058cff36cb1c66.tar.gz
git-481e6aaaccbef810f6c43cfd46058cff36cb1c66.tar.bz2
Merge branch 'tr/diff-submodule-no-reuse-worktree'
"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 7c59bfe..e9a8874 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)