diff mbox series

[03/13] bisect--helper: pass arg[cv] down to do_bisect_run

Message ID 8a815e231100b8bfcf2b03355cf11a36b2962a38.1667667460.git.congdanhqx@gmail.com (mailing list archive)
State Superseded
Headers show
Series Turn git-bisect to be builtin | expand

Commit Message

Đoàn Trần Công Danh Nov. 5, 2022, 5:07 p.m. UTC
Commit d1bbbe45df8 (bisect--helper: reimplement `bisect_run` shell
function in C, 2021-09-13) has changed the logging of bisect-run by
adding one more space before argv[0], and single-quoting all arguments.

In a later change, we would like to restore the old behaviours,
which would need information regarding argc and argv.

Let's pass them down, now.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 builtin/bisect--helper.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index ee1197c8b2..35e5dc4bbf 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -1141,7 +1141,7 @@  static int get_first_good(const char *refname UNUSED,
 	return 1;
 }
 
-static int do_bisect_run(const char *command)
+static int do_bisect_run(const char *command, int argc UNUSED, const char **argv UNUSED)
 {
 	struct child_process cmd = CHILD_PROCESS_INIT;
 
@@ -1151,7 +1151,7 @@  static int do_bisect_run(const char *command)
 	return run_command(&cmd);
 }
 
-static int verify_good(const struct bisect_terms *terms, const char *command)
+static int verify_good(const struct bisect_terms *terms, const char *command, int argc, const char **argv)
 {
 	int rc;
 	enum bisect_error res;
@@ -1171,7 +1171,7 @@  static int verify_good(const struct bisect_terms *terms, const char *command)
 	if (res != BISECT_OK)
 		return -1;
 
-	rc = do_bisect_run(command);
+	rc = do_bisect_run(command, argc, argv);
 
 	res = bisect_checkout(&current_rev, no_checkout);
 	if (res != BISECT_OK)
@@ -1198,7 +1198,7 @@  static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
 
 	sq_quote_argv(&command, argv);
 	while (1) {
-		res = do_bisect_run(command.buf);
+		res = do_bisect_run(command.buf, argc, argv);
 
 		/*
 		 * Exit code 126 and 127 can either come from the shell
@@ -1208,7 +1208,7 @@  static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
 		 * missing or non-executable script.
 		 */
 		if (is_first_run && (res == 126 || res == 127)) {
-			int rc = verify_good(terms, command.buf);
+			int rc = verify_good(terms, command.buf, argc, argv);
 			is_first_run = 0;
 			if (rc < 0) {
 				error(_("unable to verify '%s' on good"