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