2010-12-27 02:26:04 +01:00
|
|
|
#include "cache.h"
|
|
|
|
#include "run-command.h"
|
|
|
|
|
2012-04-10 21:07:34 +02:00
|
|
|
int main(int argc, const char **argv)
|
2010-12-27 02:26:04 +01:00
|
|
|
{
|
|
|
|
struct child_process cp;
|
|
|
|
int nogit = 0;
|
|
|
|
|
2011-03-22 13:50:08 +01:00
|
|
|
setup_git_directory_gently(&nogit);
|
2010-12-27 02:26:04 +01:00
|
|
|
if (nogit)
|
|
|
|
die("No git repo found");
|
2012-04-10 21:07:34 +02:00
|
|
|
if (argc > 1 && !strcmp(argv[1], "--setup-work-tree")) {
|
2010-12-27 02:26:04 +01:00
|
|
|
setup_work_tree();
|
|
|
|
argv++;
|
|
|
|
}
|
|
|
|
memset(&cp, 0, sizeof(cp));
|
|
|
|
cp.git_cmd = 1;
|
2012-04-10 21:07:34 +02:00
|
|
|
cp.argv = argv + 1;
|
2010-12-27 02:26:04 +01:00
|
|
|
return run_command(&cp);
|
|
|
|
}
|