diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-10-30 08:00:19 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-30 08:00:20 -0700 |
| commit | 27a1735807f64fb40fa20187a7dba9779d51fd5a (patch) | |
| tree | 7f09fd13ea406610ccd71c4cddf490daeebb2fbc /diff.c | |
| parent | 55547380384c77071b2fc8ff4cc570434a4793d1 (diff) | |
| parent | 3ed5d8bd7366076fd049e735e363e5a77656743c (diff) | |
Merge branch 'ly/diff-name-only-with-diff-from-content'
Regression fixes for a topic that has already been merged.
* ly/diff-name-only-with-diff-from-content:
diff: stop output garbled message in dry run mode
Diffstat (limited to 'diff.c')
| -rw-r--r-- | diff.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -1351,6 +1351,9 @@ static void emit_diff_symbol_from_struct(struct diff_options *o, int len = eds->len; unsigned flags = eds->flags; + if (o->dry_run) + return; + switch (s) { case DIFF_SYMBOL_NO_LF_EOF: context = diff_get_color_opt(o, DIFF_CONTEXT); @@ -4420,7 +4423,7 @@ static void run_external_diff(const struct external_diff *pgm, { struct child_process cmd = CHILD_PROCESS_INIT; struct diff_queue_struct *q = &diff_queued_diff; - int quiet = !(o->output_format & DIFF_FORMAT_PATCH); + int quiet = !(o->output_format & DIFF_FORMAT_PATCH) || o->dry_run; int rc; /* @@ -4615,7 +4618,8 @@ static void run_diff_cmd(const struct external_diff *pgm, p->status == DIFF_STATUS_RENAMED) o->found_changes = 1; } else { - fprintf(o->file, "* Unmerged path %s\n", name); + if (!o->dry_run) + fprintf(o->file, "* Unmerged path %s\n", name); o->found_changes = 1; } } |
