* by/log-follow: tests: rename duplicate t4205 Make git log --follow find copies among unmodified files. Make diffcore_std only can run once before a diff_flush Add a macro DIFF_QUEUE_CLEAR.
···5757 commits, and doesn't limit diff for those commits.
58585959--follow::
6060- Continue listing the history of a file beyond renames.
6060+ Continue listing the history of a file beyond renames/copies.
61616262--log-size::
6363 Before the log message print out its size in bytes. Intended
+13-8
diff.c
···26002600void diff_setup(struct diff_options *options)
26012601{
26022602 memset(options, 0, sizeof(*options));
26032603+ memset(&diff_queued_diff, 0, sizeof(diff_queued_diff));
2603260426042605 options->file = stdout;
26052606···35413542 diff_free_filepair(q->queue[i]);
3542354335433544 free(q->queue);
35443544- q->queue = NULL;
35453545- q->nr = q->alloc = 0;
35453545+ DIFF_QUEUE_CLEAR(q);
3546354635473547 return result;
35483548}
···36703670 diff_free_filepair(q->queue[i]);
36713671free_queue:
36723672 free(q->queue);
36733673- q->queue = NULL;
36743674- q->nr = q->alloc = 0;
36733673+ DIFF_QUEUE_CLEAR(q);
36753674 if (options->close_file)
36763675 fclose(options->file);
36773676···36933692 int i;
36943693 struct diff_queue_struct *q = &diff_queued_diff;
36953694 struct diff_queue_struct outq;
36963696- outq.queue = NULL;
36973697- outq.nr = outq.alloc = 0;
36953695+ DIFF_QUEUE_CLEAR(&outq);
3698369636993697 if (!filter)
37003698 return;
···37623760 int i;
37633761 struct diff_queue_struct *q = &diff_queued_diff;
37643762 struct diff_queue_struct outq;
37653765- outq.queue = NULL;
37663766- outq.nr = outq.alloc = 0;
37633763+ DIFF_QUEUE_CLEAR(&outq);
3767376437683765 for (i = 0; i < q->nr; i++) {
37693766 struct diff_filepair *p = q->queue[i];
···3824382138253822void diffcore_std(struct diff_options *options)
38263823{
38243824+ /* We never run this function more than one time, because the
38253825+ * rename/copy detection logic can only run once.
38263826+ */
38273827+ if (diff_queued_diff.run)
38283828+ return;
38293829+38273830 if (options->skip_stat_unmatch)
38283831 diffcore_skip_stat_unmatch(options);
38293832 if (options->break_opt != -1)
···38433846 DIFF_OPT_SET(options, HAS_CHANGES);
38443847 else
38453848 DIFF_OPT_CLR(options, HAS_CHANGES);
38493849+38503850+ diff_queued_diff.run = 1;
38463851}
3847385238483853int diff_result_code(struct diff_options *opt, int status)
+2-4
diffcore-break.c
···162162 if (!merge_score)
163163 merge_score = DEFAULT_MERGE_SCORE;
164164165165- outq.nr = outq.alloc = 0;
166166- outq.queue = NULL;
165165+ DIFF_QUEUE_CLEAR(&outq);
167166168167 for (i = 0; i < q->nr; i++) {
169168 struct diff_filepair *p = q->queue[i];
···256255 struct diff_queue_struct outq;
257256 int i, j;
258257259259- outq.nr = outq.alloc = 0;
260260- outq.queue = NULL;
258258+ DIFF_QUEUE_CLEAR(&outq);
261259262260 for (i = 0; i < q->nr; i++) {
263261 struct diff_filepair *p = q->queue[i];
+1-2
diffcore-pickaxe.c
···5555 int i, has_changes;
5656 regex_t regex, *regexp = NULL;
5757 struct diff_queue_struct outq;
5858- outq.queue = NULL;
5959- outq.nr = outq.alloc = 0;
5858+ DIFF_QUEUE_CLEAR(&outq);
60596160 if (opts & DIFF_PICKAXE_REGEX) {
6261 int err;
+1-2
diffcore-rename.c
···569569 /* At this point, we have found some renames and copies and they
570570 * are recorded in rename_dst. The original list is still in *q.
571571 */
572572- outq.queue = NULL;
573573- outq.nr = outq.alloc = 0;
572572+ DIFF_QUEUE_CLEAR(&outq);
574573 for (i = 0; i < q->nr; i++) {
575574 struct diff_filepair *p = q->queue[i];
576575 struct diff_filepair *pair_to_free = NULL;