|
40 | 40 | #include "setup.h"
|
41 | 41 | #include "strmap.h"
|
42 | 42 | #include "ws.h"
|
43 |
| -#include "write-or-die.h" |
44 | 43 |
|
45 | 44 | #ifdef NO_FAST_WORKING_DIRECTORY
|
46 | 45 | #define FAST_WORKING_DIRECTORY 0
|
@@ -4397,33 +4396,8 @@ static void run_external_diff(const char *pgm,
|
4397 | 4396 | diff_free_filespec_data(one);
|
4398 | 4397 | diff_free_filespec_data(two);
|
4399 | 4398 | cmd.use_shell = 1;
|
4400 |
| - if (o->flags.diff_from_contents) { |
4401 |
| - int got_output = 0; |
4402 |
| - cmd.out = -1; |
4403 |
| - if (start_command(&cmd)) |
4404 |
| - die(_("external diff died, stopping at %s"), name); |
4405 |
| - for (;;) { |
4406 |
| - char buffer[8192]; |
4407 |
| - ssize_t len = xread(cmd.out, buffer, sizeof(buffer)); |
4408 |
| - if (!len) |
4409 |
| - break; |
4410 |
| - if (len < 0) |
4411 |
| - die(_("unable to read from external diff," |
4412 |
| - " stopping at %s"), name); |
4413 |
| - got_output = 1; |
4414 |
| - if (write_in_full(1, buffer, len) < 0) |
4415 |
| - die(_("unable to write output of external diff," |
4416 |
| - " stopping at %s"), name); |
4417 |
| - } |
4418 |
| - close(cmd.out); |
4419 |
| - if (finish_command(&cmd)) |
4420 |
| - die(_("external diff died, stopping at %s"), name); |
4421 |
| - if (got_output) |
4422 |
| - o->found_changes = 1; |
4423 |
| - } else { |
4424 |
| - if (run_command(&cmd)) |
4425 |
| - die(_("external diff died, stopping at %s"), name); |
4426 |
| - } |
| 4399 | + if (run_command(&cmd)) |
| 4400 | + die(_("external diff died, stopping at %s"), name); |
4427 | 4401 |
|
4428 | 4402 | remove_tempfile();
|
4429 | 4403 | }
|
@@ -4870,7 +4844,6 @@ void diff_setup_done(struct diff_options *options)
|
4870 | 4844 | */
|
4871 | 4845 |
|
4872 | 4846 | if ((options->xdl_opts & XDF_WHITESPACE_FLAGS) ||
|
4873 |
| - options->flags.exit_with_status || |
4874 | 4847 | options->ignore_regex_nr)
|
4875 | 4848 | options->flags.diff_from_contents = 1;
|
4876 | 4849 | else
|
@@ -6759,7 +6732,7 @@ void diff_flush(struct diff_options *options)
|
6759 | 6732 | if (output_format & DIFF_FORMAT_CALLBACK)
|
6760 | 6733 | options->format_callback(q, options, options->format_callback_data);
|
6761 | 6734 |
|
6762 |
| - if ((!output_format || output_format & DIFF_FORMAT_NO_OUTPUT) && |
| 6735 | + if (output_format & DIFF_FORMAT_NO_OUTPUT && |
6763 | 6736 | options->flags.exit_with_status &&
|
6764 | 6737 | options->flags.diff_from_contents) {
|
6765 | 6738 | /*
|
|
0 commit comments