aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/RelNotes/2.46.0.txt7
-rw-r--r--diff.c33
-rwxr-xr-xt/t4020-diff-external.sh8
3 files changed, 10 insertions, 38 deletions
diff --git a/Documentation/RelNotes/2.46.0.txt b/Documentation/RelNotes/2.46.0.txt
index 6d7fee5501..a65261fd7e 100644
--- a/Documentation/RelNotes/2.46.0.txt
+++ b/Documentation/RelNotes/2.46.0.txt
@@ -34,6 +34,9 @@ UI, Workflows & Features
* "git tag" learned the "--trailer" option to futz with the trailers
in the same way as "git commit" does.
+ * A new global "--no-advice" option can be used to disable all advice
+ messages, which is meant to be used only in scripts.
+
Performance, Internal Implementation, Development Support etc.
@@ -64,6 +67,10 @@ Performance, Internal Implementation, Development Support etc.
* The "whitespace check" task that was enabled for GitHub Actions CI
has been ported to GitLab CI.
+ * The refs API lost functions that implicitly assumes to work on the
+ primary ref_store by forcing the callers to pass a ref_store as an
+ argument.
+
Fixes since v2.45
-----------------
diff --git a/diff.c b/diff.c
index cd3c8a3978..ded9ac70df 100644
--- a/diff.c
+++ b/diff.c
@@ -40,7 +40,6 @@
#include "setup.h"
#include "strmap.h"
#include "ws.h"
-#include "write-or-die.h"
#ifdef NO_FAST_WORKING_DIRECTORY
#define FAST_WORKING_DIRECTORY 0
@@ -4405,33 +4404,8 @@ static void run_external_diff(const char *pgm,
diff_free_filespec_data(one);
diff_free_filespec_data(two);
cmd.use_shell = 1;
- if (o->flags.diff_from_contents) {
- int got_output = 0;
- cmd.out = -1;
- if (start_command(&cmd))
- die(_("external diff died, stopping at %s"), name);
- for (;;) {
- char buffer[8192];
- ssize_t len = xread(cmd.out, buffer, sizeof(buffer));
- if (!len)
- break;
- if (len < 0)
- die(_("unable to read from external diff,"
- " stopping at %s"), name);
- got_output = 1;
- if (write_in_full(1, buffer, len) < 0)
- die(_("unable to write output of external diff,"
- " stopping at %s"), name);
- }
- close(cmd.out);
- if (finish_command(&cmd))
- die(_("external diff died, stopping at %s"), name);
- if (got_output)
- o->found_changes = 1;
- } else {
- if (run_command(&cmd))
- die(_("external diff died, stopping at %s"), name);
- }
+ if (run_command(&cmd))
+ die(_("external diff died, stopping at %s"), name);
remove_tempfile();
}
@@ -4878,7 +4852,6 @@ void diff_setup_done(struct diff_options *options)
*/
if ((options->xdl_opts & XDF_WHITESPACE_FLAGS) ||
- options->flags.exit_with_status ||
options->ignore_regex_nr)
options->flags.diff_from_contents = 1;
else
@@ -6769,7 +6742,7 @@ void diff_flush(struct diff_options *options)
if (output_format & DIFF_FORMAT_CALLBACK)
options->format_callback(q, options, options->format_callback_data);
- if ((!output_format || output_format & DIFF_FORMAT_NO_OUTPUT) &&
+ if (output_format & DIFF_FORMAT_NO_OUTPUT &&
options->flags.exit_with_status &&
options->flags.diff_from_contents) {
/*
diff --git a/t/t4020-diff-external.sh b/t/t4020-diff-external.sh
index 26430ca66b..fdd865f7c3 100755
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
@@ -172,14 +172,6 @@ test_expect_success 'no diff with -diff' '
grep Binary out
'
-test_expect_success 'diff.external and --exit-code with output' '
- test_expect_code 1 git -c diff.external=echo diff --exit-code
-'
-
-test_expect_success 'diff.external and --exit-code without output' '
- git -c diff.external=true diff --exit-code
-'
-
echo NULZbetweenZwords | perl -pe 'y/Z/\000/' > file
test_expect_success 'force diff with "diff"' '