зеркало из https://github.com/microsoft/git.git
diff.c: factor out diff_flush_patch_all_file_pairs
In a later patch we want to do more things before and after all filepairs are flushed. So factor flushing out all file pairs into its own function that the new code can be plugged in easily. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
dfb7728f63
Коммит
ec33150671
17
diff.c
17
diff.c
|
@ -4734,6 +4734,17 @@ void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc)
|
||||||
warning(_(rename_limit_advice), varname, needed);
|
warning(_(rename_limit_advice), varname, needed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void diff_flush_patch_all_file_pairs(struct diff_options *o)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
struct diff_queue_struct *q = &diff_queued_diff;
|
||||||
|
for (i = 0; i < q->nr; i++) {
|
||||||
|
struct diff_filepair *p = q->queue[i];
|
||||||
|
if (check_pair_status(p))
|
||||||
|
diff_flush_patch(p, o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void diff_flush(struct diff_options *options)
|
void diff_flush(struct diff_options *options)
|
||||||
{
|
{
|
||||||
struct diff_queue_struct *q = &diff_queued_diff;
|
struct diff_queue_struct *q = &diff_queued_diff;
|
||||||
|
@ -4826,11 +4837,7 @@ void diff_flush(struct diff_options *options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < q->nr; i++) {
|
diff_flush_patch_all_file_pairs(options);
|
||||||
struct diff_filepair *p = q->queue[i];
|
|
||||||
if (check_pair_status(p))
|
|
||||||
diff_flush_patch(p, options);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output_format & DIFF_FORMAT_CALLBACK)
|
if (output_format & DIFF_FORMAT_CALLBACK)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче