]> git.ipfire.org Git - thirdparty/git.git/blame - test-subprocess.c
checkout: avoid unnecessary match_pathspec calls
[thirdparty/git.git] / test-subprocess.c
CommitLineData
0ed74813
NTND
1#include "cache.h"
2#include "run-command.h"
3
a961d1f1 4int main(int argc, const char **argv)
0ed74813 5{
0ed74813
NTND
6 struct child_process cp;
7 int nogit = 0;
8
c0aa335c 9 setup_git_directory_gently(&nogit);
0ed74813
NTND
10 if (nogit)
11 die("No git repo found");
a961d1f1 12 if (argc > 1 && !strcmp(argv[1], "--setup-work-tree")) {
0ed74813
NTND
13 setup_work_tree();
14 argv++;
15 }
16 memset(&cp, 0, sizeof(cp));
17 cp.git_cmd = 1;
a961d1f1 18 cp.argv = argv + 1;
0ed74813
NTND
19 return run_command(&cp);
20}