builtin-am: remove redirection to git-am.sh

At the beginning of the rewrite of git-am.sh to C, in order to not break existing test scripts that depended on a functional git-am, a redirection to git-am.sh was introduced that would activate if the environment variable _GIT_USE_BUILTIN_AM was not defined. Now that all of git-am.sh's functionality has been re-implemented in builtin/am.c, remove this redirection, and retire git-am.sh into contrib/examples/. Signed-off-by: Paul Tan <pyokagan@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Paul Tan committed Aug 4, 2015 at 21:52 UTC 783d7e865ec8f6190f8d3abe3ab72a9410d611f1
4 files changed +1 -22
Makefile
-1
@@ -467,7 +467,6 @@ TEST_PROGRAMS_NEED_X =
467 # interactive shell sessions without exporting it.
468 unexport CDPATH
469
470 -SCRIPT_SH += git-am.sh
470 SCRIPT_SH += git-bisect.sh
471 SCRIPT_SH += git-difftool--helper.sh
472 SCRIPT_SH += git-filter-branch.sh
builtin/am.c
-15
@@ -2221,21 +2221,6 @@ int cmd_am(int argc, const char **argv, const char *prefix)
2221 OPT_END()
2222 };
2223
2224 - /*
2225 - * NEEDSWORK: Once all the features of git-am.sh have been
2226 - * re-implemented in builtin/am.c, this preamble can be removed.
2227 - */
2228 - if (!getenv("_GIT_USE_BUILTIN_AM")) {
2229 - const char *path = mkpath("%s/git-am", git_exec_path());
2230 -
2231 - if (sane_execvp(path, (char **)argv) < 0)
2232 - die_errno("could not exec %s", path);
2233 - } else {
2234 - prefix = setup_git_directory();
2235 - trace_repo_setup(prefix);
2236 - setup_work_tree();
2237 - }
2238 -
2224 git_config(git_default_config, NULL);
2225
2226 am_state_init(&state, git_path("rebase-apply"));
contrib/examples/git-am.sh renamed
git.c
+1 -6
@@ -370,12 +370,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
370
371 static struct cmd_struct commands[] = {
372 { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
373 - /*
374 - * NEEDSWORK: Once the redirection to git-am.sh in builtin/am.c has
375 - * been removed, this entry should be changed to
376 - * RUN_SETUP | NEED_WORK_TREE
377 - */
378 - { "am", cmd_am },
373 + { "am", cmd_am, RUN_SETUP | NEED_WORK_TREE },
374 { "annotate", cmd_annotate, RUN_SETUP },
375 { "apply", cmd_apply, RUN_SETUP_GENTLY },
376 { "archive", cmd_archive },