|
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 |
@@ -4405,33 +4404,8 @@ static void run_external_diff(const char *pgm, |
4405 | 4404 | diff_free_filespec_data(one); |
4406 | 4405 | diff_free_filespec_data(two); |
4407 | 4406 | cmd.use_shell = 1; |
4408 | | - if (o->flags.diff_from_contents) { |
4409 | | - int got_output = 0; |
4410 | | - cmd.out = -1; |
4411 | | - if (start_command(&cmd)) |
4412 | | - die(_("external diff died, stopping at %s"), name); |
4413 | | - for (;;) { |
4414 | | - char buffer[8192]; |
4415 | | - ssize_t len = xread(cmd.out, buffer, sizeof(buffer)); |
4416 | | - if (!len) |
4417 | | - break; |
4418 | | - if (len < 0) |
4419 | | - die(_("unable to read from external diff," |
4420 | | - " stopping at %s"), name); |
4421 | | - got_output = 1; |
4422 | | - if (write_in_full(1, buffer, len) < 0) |
4423 | | - die(_("unable to write output of external diff," |
4424 | | - " stopping at %s"), name); |
4425 | | - } |
4426 | | - close(cmd.out); |
4427 | | - if (finish_command(&cmd)) |
4428 | | - die(_("external diff died, stopping at %s"), name); |
4429 | | - if (got_output) |
4430 | | - o->found_changes = 1; |
4431 | | - } else { |
4432 | | - if (run_command(&cmd)) |
4433 | | - die(_("external diff died, stopping at %s"), name); |
4434 | | - } |
| 4407 | + if (run_command(&cmd)) |
| 4408 | + die(_("external diff died, stopping at %s"), name); |
4435 | 4409 |
|
4436 | 4410 | remove_tempfile(); |
4437 | 4411 | } |
@@ -4878,7 +4852,6 @@ void diff_setup_done(struct diff_options *options) |
4878 | 4852 | */ |
4879 | 4853 |
|
4880 | 4854 | if ((options->xdl_opts & XDF_WHITESPACE_FLAGS) || |
4881 | | - options->flags.exit_with_status || |
4882 | 4855 | options->ignore_regex_nr) |
4883 | 4856 | options->flags.diff_from_contents = 1; |
4884 | 4857 | else |
@@ -6769,7 +6742,7 @@ void diff_flush(struct diff_options *options) |
6769 | 6742 | if (output_format & DIFF_FORMAT_CALLBACK) |
6770 | 6743 | options->format_callback(q, options, options->format_callback_data); |
6771 | 6744 |
|
6772 | | - if ((!output_format || output_format & DIFF_FORMAT_NO_OUTPUT) && |
| 6745 | + if (output_format & DIFF_FORMAT_NO_OUTPUT && |
6773 | 6746 | options->flags.exit_with_status && |
6774 | 6747 | options->flags.diff_from_contents) { |
6775 | 6748 | /* |
|
0 commit comments