builtin-am: implement skeletal builtin am
[git/mingw.git] / builtin / am.c
blobfd32caf107027df42e19fd15d1be319b66b17077
1 /*
2 * Builtin "git am"
4 * Based on git-am.sh by Junio C Hamano.
5 */
6 #include "cache.h"
7 #include "builtin.h"
8 #include "exec_cmd.h"
10 int cmd_am(int argc, const char **argv, const char *prefix)
14 * NEEDSWORK: Once all the features of git-am.sh have been
15 * re-implemented in builtin/am.c, this preamble can be removed.
17 if (!getenv("_GIT_USE_BUILTIN_AM")) {
18 const char *path = mkpath("%s/git-am", git_exec_path());
20 if (sane_execvp(path, (char **)argv) < 0)
21 die_errno("could not exec %s", path);
22 } else {
23 prefix = setup_git_directory();
24 trace_repo_setup(prefix);
25 setup_work_tree();
28 return 0;