Skip to content

Commit 783d7e8

Browse files
pyokagangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5e4f9cf commit 783d7e8

File tree

4 files changed

+1
-22
lines changed

4 files changed

+1
-22
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ TEST_PROGRAMS_NEED_X =
467467
# interactive shell sessions without exporting it.
468468
unexport CDPATH
469469

470-
SCRIPT_SH += git-am.sh
471470
SCRIPT_SH += git-bisect.sh
472471
SCRIPT_SH += git-difftool--helper.sh
473472
SCRIPT_SH += git-filter-branch.sh

builtin/am.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,21 +2221,6 @@ int cmd_am(int argc, const char **argv, const char *prefix)
22212221
OPT_END()
22222222
};
22232223

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-
22392224
git_config(git_default_config, NULL);
22402225

22412226
am_state_init(&state, git_path("rebase-apply"));
File renamed without changes.

git.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
370370

371371
static struct cmd_struct commands[] = {
372372
{ "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 },
379374
{ "annotate", cmd_annotate, RUN_SETUP },
380375
{ "apply", cmd_apply, RUN_SETUP_GENTLY },
381376
{ "archive", cmd_archive },

0 commit comments

Comments
 (0)