Merge branch 'dt/reflog-tests'
[gitweb.git] / builtin / am.c
index 3c503920138c567bb756f093d9c684eae8f66834..1399c8dd880f86190534b9c9e0a5e84f48ebeceb 100644 (file)
@@ -152,6 +152,8 @@ static void am_state_init(struct am_state *state, const char *dir)
 
        state->prec = 4;
 
+       git_config_get_bool("am.threeway", &state->threeway);
+
        state->utf8 = 1;
 
        git_config_get_bool("am.messageid", &state->message_id);
@@ -2221,21 +2223,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"));
@@ -2246,6 +2233,9 @@ int cmd_am(int argc, const char **argv, const char *prefix)
                fprintf_ln(stderr, _("The -b/--binary option has been a no-op for long time, and\n"
                                "it will be removed. Please do not use it anymore."));
 
+       /* Ensure a valid committer ident can be constructed */
+       git_committer_info(IDENT_STRICT);
+
        if (read_index_preload(&the_index, NULL) < 0)
                die(_("failed to read the index"));