MCPcopy Index your code
hub / github.com/git/git / log_tree_diff_flush

Function log_tree_diff_flush

log-tree.c:926–973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

924}
925
926int log_tree_diff_flush(struct rev_info *opt)
927{
928 opt->shown_dashes = 0;
929 diffcore_std(&opt->diffopt);
930
931 if (diff_queue_is_empty(&opt->diffopt)) {
932 int saved_fmt = opt->diffopt.output_format;
933 opt->diffopt.output_format = DIFF_FORMAT_NO_OUTPUT;
934 diff_flush(&opt->diffopt);
935 opt->diffopt.output_format = saved_fmt;
936 return 0;
937 }
938
939 if (opt->loginfo && !opt->no_commit_id) {
940 show_log(opt);
941 if ((opt->diffopt.output_format & ~DIFF_FORMAT_NO_OUTPUT) &&
942 opt->verbose_header &&
943 opt->commit_format != CMIT_FMT_ONELINE &&
944 !commit_format_is_empty(opt->commit_format)) {
945 /*
946 * When showing a verbose header (i.e. log message),
947 * and not in --pretty=oneline format, we would want
948 * an extra newline between the end of log and the
949 * diff/diffstat output for readability.
950 */
951 int pch = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_PATCH;
952 fputs(diff_line_prefix(&opt->diffopt), opt->diffopt.file);
953
954 /*
955 * We may have shown three-dashes line early
956 * between generated commentary (notes, etc.)
957 * and the log message, in which case we only
958 * want a blank line after the commentary
959 * without (an extra) three-dashes line.
960 * Otherwise, we show the three-dashes line if
961 * we are showing the patch with diffstat, but
962 * in that case, there is no extra blank line
963 * after the three-dashes line.
964 */
965 if (!opt->shown_dashes &&
966 (pch & opt->diffopt.output_format) == pch)
967 fprintf(opt->diffopt.file, "---");
968 putc('\n', opt->diffopt.file);
969 }
970 }
971 diff_flush(&opt->diffopt);
972 return 1;
973}
974
975static int do_diff_combined(struct rev_info *opt, struct commit *commit)
976{

Callers 8

pick_commitsFunction · 0.85
do_remerge_diffFunction · 0.85
log_tree_diffFunction · 0.85
handle_commitFunction · 0.85
show_stashFunction · 0.85
stdin_diff_treesFunction · 0.85
cmd_diff_treeFunction · 0.85
builtin_diff_treeFunction · 0.85

Calls 6

diffcore_stdFunction · 0.85
diff_queue_is_emptyFunction · 0.85
diff_flushFunction · 0.85
show_logFunction · 0.85
commit_format_is_emptyFunction · 0.85
diff_line_prefixFunction · 0.85

Tested by

no test coverage detected