Skip to content

Commit cfb19ae

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e3d1be4 commit cfb19ae

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

combine-diff.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,9 @@ void diff_tree_combined(const struct object_id *oid,
15011501
if (opt->ignore_regex_nr)
15021502
die("combined diff and '%s' cannot be used together",
15031503
"--ignore-matching-lines");
1504+
if (opt->close_file)
1505+
die("combined diff and '%s' cannot be used together",
1506+
"--output");
15041507

15051508
/* nothing to do, if no parents */
15061509
if (!num_parent)

0 commit comments

Comments
 (0)