summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-06-13 22:53:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-06-13 22:53:41 (GMT)
commit1a7f6be5b17f572fc68ff2a2e0c079d50c671c74 (patch)
tree1968c2539b29085e584648a5b8079551ec61b752 /t/helper
parent66c2948ffd6e376447252a3a72f7ce78eeef3e52 (diff)
parenta082345372e14ecd30a84a790eda0c38154e4602 (diff)
downloadgit-1a7f6be5b17f572fc68ff2a2e0c079d50c671c74.zip
git-1a7f6be5b17f572fc68ff2a2e0c079d50c671c74.tar.gz
git-1a7f6be5b17f572fc68ff2a2e0c079d50c671c74.tar.bz2
Merge branch 'ab/hooks-regression-fix'
In Git 2.36 we revamped the way how hooks are invoked. One change that is end-user visible is that the output of a hook is no longer directly connected to the standard output of "git" that spawns the hook, which was noticed post release. This is getting corrected. * ab/hooks-regression-fix: hook API: fix v2.36.0 regression: hooks should be connected to a TTY run-command: add an "ungroup" option to run_process_parallel()
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-run-command.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c
index 9050e31..c9283b4 100644
--- a/t/helper/test-run-command.c
+++ b/t/helper/test-run-command.c
@@ -31,7 +31,11 @@ static int parallel_next(struct child_process *cp,
return 0;
strvec_pushv(&cp->args, d->args.v);
- strbuf_addstr(err, "preloaded output of a child\n");
+ if (err)
+ strbuf_addstr(err, "preloaded output of a child\n");
+ else
+ fprintf(stderr, "preloaded output of a child\n");
+
number_callbacks++;
return 1;
}
@@ -41,7 +45,10 @@ static int no_job(struct child_process *cp,
void *cb,
void **task_cb)
{
- strbuf_addstr(err, "no further jobs available\n");
+ if (err)
+ strbuf_addstr(err, "no further jobs available\n");
+ else
+ fprintf(stderr, "no further jobs available\n");
return 0;
}
@@ -50,7 +57,10 @@ static int task_finished(int result,
void *pp_cb,
void *pp_task_cb)
{
- strbuf_addstr(err, "asking for a quick stop\n");
+ if (err)
+ strbuf_addstr(err, "asking for a quick stop\n");
+ else
+ fprintf(stderr, "asking for a quick stop\n");
return 1;
}
@@ -407,6 +417,12 @@ int cmd__run_command(int argc, const char **argv)
if (!strcmp(argv[1], "run-command"))
exit(run_command(&proc));
+ if (!strcmp(argv[1], "--ungroup")) {
+ argv += 1;
+ argc -= 1;
+ run_processes_parallel_ungroup = 1;
+ }
+
jobs = atoi(argv[2]);
strvec_clear(&proc.args);
strvec_pushv(&proc.args, (const char **)argv + 3);