| 924 | } |
| 925 | |
| 926 | int 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 | |
| 975 | static int do_diff_combined(struct rev_info *opt, struct commit *commit) |
| 976 | { |
no test coverage detected