Code

am: remove support for -d .dotest
[git.git] / git.c
diff --git a/git.c b/git.c
index 01bbbc73258dc66d8d3a8253cc9328b5b18346aa..9cca81a60e6d4f93cf3132b76fd8f147a6a5d98f 100644 (file)
--- a/git.c
+++ b/git.c
@@ -87,17 +87,6 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)
        return handled;
 }
 
-static const char *alias_command;
-static char *alias_string;
-
-static int git_alias_config(const char *var, const char *value)
-{
-       if (!prefixcmp(var, "alias.") && !strcmp(var + 6, alias_command)) {
-               alias_string = xstrdup(value);
-       }
-       return 0;
-}
-
 static int split_cmdline(char *cmdline, const char ***argv)
 {
        int src, dst, count = 0, size = 16;
@@ -157,11 +146,13 @@ static int handle_alias(int *argcp, const char ***argv)
        const char *subdir;
        int count, option_count;
        const char** new_argv;
+       const char *alias_command;
+       char *alias_string;
 
        subdir = setup_git_directory_gently(&nongit);
 
        alias_command = (*argv)[0];
-       git_config(git_alias_config);
+       alias_string = alias_lookup(alias_command);
        if (alias_string) {
                if (alias_string[0] == '!') {
                        if (*argcp > 1) {
@@ -169,7 +160,7 @@ static int handle_alias(int *argcp, const char ***argv)
 
                                strbuf_init(&buf, PATH_MAX);
                                strbuf_addstr(&buf, alias_string);
-                               sq_quote_argv(&buf, (*argv) + 1, *argcp - 1, PATH_MAX);
+                               sq_quote_argv(&buf, (*argv) + 1, PATH_MAX);
                                free(alias_string);
                                alias_string = buf.buf;
                        }
@@ -198,7 +189,7 @@ static int handle_alias(int *argcp, const char ***argv)
                if (!strcmp(alias_command, new_argv[0]))
                        die("recursive alias: %s", alias_command);
 
-               trace_argv_printf(new_argv, count,
+               trace_argv_printf(new_argv,
                                  "trace: alias expansion: %s =>",
                                  alias_command);
 
@@ -252,7 +243,7 @@ static int run_command(struct cmd_struct *p, int argc, const char **argv)
        if (p->option & NEED_WORK_TREE)
                setup_work_tree();
 
-       trace_argv_printf(argv, argc, "trace: built-in: git");
+       trace_argv_printf(argv, "trace: built-in: git");
 
        status = p->fn(argc, argv, prefix);
        if (status)
@@ -287,6 +278,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "branch", cmd_branch, RUN_SETUP },
                { "bundle", cmd_bundle },
                { "cat-file", cmd_cat_file, RUN_SETUP },
+               { "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
                { "checkout-index", cmd_checkout_index,
                        RUN_SETUP | NEED_WORK_TREE},
                { "check-ref-format", cmd_check_ref_format },
@@ -294,6 +286,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "cherry", cmd_cherry, RUN_SETUP },
                { "cherry-pick", cmd_cherry_pick, RUN_SETUP | NEED_WORK_TREE },
                { "clean", cmd_clean, RUN_SETUP | NEED_WORK_TREE },
+               { "commit", cmd_commit, RUN_SETUP | NEED_WORK_TREE },
                { "commit-tree", cmd_commit_tree, RUN_SETUP },
                { "config", cmd_config },
                { "count-objects", cmd_count_objects, RUN_SETUP },
@@ -302,6 +295,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "diff-files", cmd_diff_files },
                { "diff-index", cmd_diff_index, RUN_SETUP },
                { "diff-tree", cmd_diff_tree, RUN_SETUP },
+               { "fast-export", cmd_fast_export, RUN_SETUP },
                { "fetch", cmd_fetch, RUN_SETUP },
                { "fetch-pack", cmd_fetch_pack, RUN_SETUP },
                { "fetch--tool", cmd_fetch__tool, RUN_SETUP },
@@ -328,6 +322,8 @@ static void handle_internal_command(int argc, const char **argv)
                { "merge-base", cmd_merge_base, RUN_SETUP },
                { "merge-file", cmd_merge_file },
                { "merge-ours", cmd_merge_ours, RUN_SETUP },
+               { "merge-recursive", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE },
+               { "merge-subtree", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE },
                { "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE },
                { "name-rev", cmd_name_rev, RUN_SETUP },
                { "pack-objects", cmd_pack_objects, RUN_SETUP },
@@ -345,11 +341,11 @@ static void handle_internal_command(int argc, const char **argv)
                { "rev-parse", cmd_rev_parse },
                { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
                { "rm", cmd_rm, RUN_SETUP },
-               { "runstatus", cmd_runstatus, RUN_SETUP | NEED_WORK_TREE },
                { "send-pack", cmd_send_pack, RUN_SETUP },
                { "shortlog", cmd_shortlog, RUN_SETUP | USE_PAGER },
                { "show-branch", cmd_show_branch, RUN_SETUP },
                { "show", cmd_show, RUN_SETUP | USE_PAGER },
+               { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
                { "stripspace", cmd_stripspace },
                { "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
                { "tag", cmd_tag, RUN_SETUP },