summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-22 23:14:25 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-25 11:35:29 -0700
commita0919ced8a5efe938cf97c74a0f851cbbe00aaf6 (patch)
tree0e2fd9892101648379d29d4d59416a6b0b440ab5 /diff-lib.c
parentb65982b60876c8f5f4d3b2898d5174f4812552b1 (diff)
downloadgit-a0919ced8a5efe938cf97c74a0f851cbbe00aaf6.tar.gz
Avoid "diff-index --cached" optimization under --find-copies-harder
When find-copies-harder is in effect, the diff frontends are expected to feed all paths, not just changed paths, to the diffcore, so that copy sources can be picked up. In such a case, not descending into subtrees using the cache-tree information is simply wrong. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 1cb97af22d..ae75eacbcc 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -446,7 +446,8 @@ int run_diff_index(struct rev_info *revs, int cached)
memset(&opts, 0, sizeof(opts));
opts.head_idx = 1;
opts.index_only = cached;
- opts.diff_index_cached = cached;
+ opts.diff_index_cached = (cached &&
+ !DIFF_OPT_TST(&revs->diffopt, FIND_COPIES_HARDER));
opts.merge = 1;
opts.fn = oneway_diff;
opts.unpack_data = revs;
@@ -503,7 +504,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt)
memset(&opts, 0, sizeof(opts));
opts.head_idx = 1;
opts.index_only = 1;
- opts.diff_index_cached = 1;
+ opts.diff_index_cached = !DIFF_OPT_TST(opt, FIND_COPIES_HARDER);
opts.merge = 1;
opts.fn = oneway_diff;
opts.unpack_data = &revs;