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
This commit is contained in:
Junio C Hamano
2014-03-18 14:03:41 -07:00
2 changed files with 32 additions and 3 deletions

5
diff.c
View File

@ -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)