diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-10-24 10:15:09 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-10-24 10:15:09 -0700 |
| commit | a7f01ac59b8caef906e0c4b39caf936d2756f064 (patch) | |
| tree | e96b3a6e109c2b26790ff0b938497d7134a66639 /diff.c | |
| parent | The twenty-third batch (diff) | |
| parent | diff: stop output garbled message in dry run mode (diff) | |
| download | git-a7f01ac59b8caef906e0c4b39caf936d2756f064.tar.gz git-a7f01ac59b8caef906e0c4b39caf936d2756f064.zip | |
Merge branch 'ly/diff-name-only-with-diff-from-content' into jk/diff-patch-dry-run-cleanup
* 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; } } |
