diff mbox series

[4/5] apply: pass through quiet flag to fix t4150

Message ID c0d670df198eabc20bf89854184db7a100cb3030.1708241613.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series promise: introduce promises to track success or error | expand

Commit Message

Philip Peterson Feb. 18, 2024, 7:33 a.m. UTC
From: Philip Peterson <philip.c.peterson@gmail.com>

This test was failing because it expects the invocation of `git apply`
to be silent. Because previous patches introduce verbosity where
previously there was a silent error (in the form of a return code), this
adds an opportunity for a bug to become visible. The bug is in the way
`git am` invokes `git apply`, not passing through --quiet when it is
specified.

Signed-off-by: Philip Peterson <philip.c.peterson@gmail.com>
---
 builtin/am.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/builtin/am.c b/builtin/am.c
index d1990d7edcb..799cb8128a3 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -36,6 +36,7 @@ 
 #include "mailinfo.h"
 #include "apply.h"
 #include "string-list.h"
+#include "packfile.h"
 #include "pager.h"
 #include "path.h"
 #include "repository.h"
@@ -2412,6 +2413,10 @@  int cmd_am(int argc, const char **argv, const char *prefix)
 
 	argc = parse_options(argc, argv, prefix, options, usage, 0);
 
+	if (state.quiet) {
+		strvec_push(&state.git_apply_opts, "--quiet");
+	}
+
 	if (binary >= 0)
 		fprintf_ln(stderr, _("The -b/--binary option has been a no-op for long time, and\n"
 				"it will be removed. Please do not use it anymore."));