summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-09-03 15:35:37 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-09-03 15:35:37 -0700
commit6a42cfe86c485675987b64690e75d8821567d328 (patch)
treebe6e1a64fa65abe7f0013e0256a9439f6e73e0ac /builtin-diff.c
parentMerge branch 'ho/dashless' into maint (diff)
parentsetup_git_directory(): fix move to worktree toplevel directory (diff)
downloadtgif-6a42cfe86c485675987b64690e75d8821567d328.tar.xz
Merge branch 'nd/worktree' into maint
* nd/worktree: setup_git_directory(): fix move to worktree toplevel directory update-index: fix worktree setup read-tree: setup worktree if merge is required grep: fix worktree setup diff*: fix worktree setup
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index 7ffea97505..037c3039a4 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -122,6 +122,8 @@ static int builtin_diff_index(struct rev_info *revs,
usage(builtin_diff_usage);
argv++; argc--;
}
+ if (!cached)
+ setup_work_tree();
/*
* Make sure there is one revision (i.e. pending object),
* and there is no revision filtering parameters.
@@ -225,6 +227,7 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv
(revs->diffopt.output_format & DIFF_FORMAT_PATCH))
revs->combine_merges = revs->dense_combined_merges = 1;
+ setup_work_tree();
if (read_cache() < 0) {
perror("read_cache");
return -1;