summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-08-18 12:47:18 -0700
committerJunio C Hamano <gitster@pobox.com>2010-08-18 12:47:18 -0700
commitbd3a97a27a97485b130802d497214be312b737f9 (patch)
tree803a7822503dc81a00e54724f3dbe9f5963dec13 /diff.c
parent6b5005c88b3a0c360249deb8ca8b92201abaa824 (diff)
parent65113121a50cd765033d51204213c817832c59cf (diff)
downloadgit-bd3a97a27a97485b130802d497214be312b737f9.tar.gz
Merge branch 'jc/maint-follow-rename-fix'
* jc/maint-follow-rename-fix: log: test for regression introduced in v1.7.2-rc0~103^2~2 diff --follow: do call diffcore_std() as necessary diff --follow: do not waste cycles while recursing
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/diff.c b/diff.c
index ccc9f1f64d..7a75bd74c9 100644
--- a/diff.c
+++ b/diff.c
@@ -4073,25 +4073,24 @@ void diffcore_fix_diff_index(struct diff_options *options)
void diffcore_std(struct diff_options *options)
{
- /* We never run this function more than one time, because the
- * rename/copy detection logic can only run once.
- */
- if (diff_queued_diff.run)
- return;
-
if (options->skip_stat_unmatch)
diffcore_skip_stat_unmatch(options);
- if (options->break_opt != -1)
- diffcore_break(options->break_opt);
- if (options->detect_rename)
- diffcore_rename(options);
- if (options->break_opt != -1)
- diffcore_merge_broken();
+ if (!options->found_follow) {
+ /* See try_to_follow_renames() in tree-diff.c */
+ if (options->break_opt != -1)
+ diffcore_break(options->break_opt);
+ if (options->detect_rename)
+ diffcore_rename(options);
+ if (options->break_opt != -1)
+ diffcore_merge_broken();
+ }
if (options->pickaxe)
diffcore_pickaxe(options->pickaxe, options->pickaxe_opts);
if (options->orderfile)
diffcore_order(options->orderfile);
- diff_resolve_rename_copy();
+ if (!options->found_follow)
+ /* See try_to_follow_renames() in tree-diff.c */
+ diff_resolve_rename_copy();
diffcore_apply_filter(options->filter);
if (diff_queued_diff.nr && !DIFF_OPT_TST(options, DIFF_FROM_CONTENTS))
@@ -4099,7 +4098,7 @@ void diffcore_std(struct diff_options *options)
else
DIFF_OPT_CLR(options, HAS_CHANGES);
- diff_queued_diff.run = 1;
+ options->found_follow = 0;
}
int diff_result_code(struct diff_options *opt, int status)