Raw
1 #define USE_THE_REPOSITORY_VARIABLE
2
3 #include "test-tool.h"
4 #include "run-command.h"
5 #include "setup.h"
6
7 int cmd__subprocess(int argc, const char **argv)
8 {
9 struct child_process cp = CHILD_PROCESS_INIT;
10 int nogit = 0;
11
12 setup_git_directory_gently(the_repository, &nogit);
13 if (nogit)
14 die("No git repo found");
15 if (argc > 1 && !strcmp(argv[1], "--setup-work-tree")) {
16 setup_work_tree(the_repository);
17 argv++;
18 }
19 cp.git_cmd = 1;
20 strvec_pushv(&cp.args, (const char **)argv + 1);
21 return run_command(&cp);
22 }