combine-diff: abort if --output is given

The code for combined diffs currently only writes to stdout. Abort and report that fact instead of silently ignoring the --output option. The (empty) output file has already been created at that point, though. Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Jun 18, 2022 at 13:12 UTC cfb19ae05f4565bc9d0a0cb3a23a3d2ab9fb8fab
1 file changed +3
combine-diff.c
+3
@@ -1501,6 +1501,9 @@ void diff_tree_combined(const struct object_id *oid,
1501 if (opt->ignore_regex_nr)
1502 die("combined diff and '%s' cannot be used together",
1503 "--ignore-matching-lines");
1504 + if (opt->close_file)
1505 + die("combined diff and '%s' cannot be used together",
1506 + "--output");
1507
1508 /* nothing to do, if no parents */
1509 if (!num_parent)