From c8bae7493d2f2910b57f13ded012e86bdcfb0532 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:47:53 +0200 Subject: Adding upstream version 1:2.39.2. Signed-off-by: Daniel Baumann --- t/helper/test-subprocess.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 t/helper/test-subprocess.c (limited to 't/helper/test-subprocess.c') diff --git a/t/helper/test-subprocess.c b/t/helper/test-subprocess.c new file mode 100644 index 0000000..ff22f2f --- /dev/null +++ b/t/helper/test-subprocess.c @@ -0,0 +1,20 @@ +#include "test-tool.h" +#include "cache.h" +#include "run-command.h" + +int cmd__subprocess(int argc, const char **argv) +{ + struct child_process cp = CHILD_PROCESS_INIT; + int nogit = 0; + + setup_git_directory_gently(&nogit); + if (nogit) + die("No git repo found"); + if (argc > 1 && !strcmp(argv[1], "--setup-work-tree")) { + setup_work_tree(); + argv++; + } + cp.git_cmd = 1; + strvec_pushv(&cp.args, (const char **)argv + 1); + return run_command(&cp); +} -- cgit v1.2.3