test-subprocess.c 393 Bytes
Newer Older
1 2 3
#include "cache.h"
#include "run-command.h"

4
int main(int argc, char **argv)
5
{
6
	struct child_process cp = CHILD_PROCESS_INIT;
7 8
	int nogit = 0;

9
	setup_git_directory_gently(&nogit);
10 11
	if (nogit)
		die("No git repo found");
12
	if (argc > 1 && !strcmp(argv[1], "--setup-work-tree")) {
13 14 15 16
		setup_work_tree();
		argv++;
	}
	cp.git_cmd = 1;
17
	cp.argv = (const char **)argv + 1;
18 19
	return run_command(&cp);
}