Skip to content

Commit

Permalink
builtin-am: remove redirection to git-am.sh
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Tan authored and Junio C Hamano committed Aug 5, 2015
1 parent 5e4f9cf commit 783d7e8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ TEST_PROGRAMS_NEED_X =
# interactive shell sessions without exporting it.
unexport CDPATH

SCRIPT_SH += git-am.sh
SCRIPT_SH += git-bisect.sh
SCRIPT_SH += git-difftool--helper.sh
SCRIPT_SH += git-filter-branch.sh
Expand Down
15 changes: 0 additions & 15 deletions builtin/am.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,21 +2221,6 @@ int cmd_am(int argc, const char **argv, const char *prefix)
OPT_END()
};

/*
* NEEDSWORK: Once all the features of git-am.sh have been
* re-implemented in builtin/am.c, this preamble can be removed.
*/
if (!getenv("_GIT_USE_BUILTIN_AM")) {
const char *path = mkpath("%s/git-am", git_exec_path());

if (sane_execvp(path, (char **)argv) < 0)
die_errno("could not exec %s", path);
} else {
prefix = setup_git_directory();
trace_repo_setup(prefix);
setup_work_tree();
}

git_config(git_default_config, NULL);

am_state_init(&state, git_path("rebase-apply"));
Expand Down
File renamed without changes.
7 changes: 1 addition & 6 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)

static struct cmd_struct commands[] = {
{ "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
/*
* NEEDSWORK: Once the redirection to git-am.sh in builtin/am.c has
* been removed, this entry should be changed to
* RUN_SETUP | NEED_WORK_TREE
*/
{ "am", cmd_am },
{ "am", cmd_am, RUN_SETUP | NEED_WORK_TREE },
{ "annotate", cmd_annotate, RUN_SETUP },
{ "apply", cmd_apply, RUN_SETUP_GENTLY },
{ "archive", cmd_archive },
Expand Down

0 comments on commit 783d7e8

Please sign in to comment.