]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git.c
push: prepare sender to receive extended ref information from the receiver
[git.git] / git.c
diff --git a/git.c b/git.c
index 74ea0e6cc52f627df1bf018770aec67584325ab5..2f5b4d72ee249821f88617a4d5a8bbf3a0204340 100644 (file)
--- a/git.c
+++ b/git.c
@@ -286,7 +286,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "count-objects", cmd_count_objects, RUN_SETUP },
                { "describe", cmd_describe, RUN_SETUP },
                { "diff", cmd_diff },
-               { "diff-files", cmd_diff_files, RUN_SETUP },
+               { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
                { "diff-index", cmd_diff_index, RUN_SETUP },
                { "diff-tree", cmd_diff_tree, RUN_SETUP },
                { "fast-export", cmd_fast_export, RUN_SETUP },
@@ -328,6 +328,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "prune-packed", cmd_prune_packed, RUN_SETUP },
                { "push", cmd_push, RUN_SETUP },
                { "read-tree", cmd_read_tree, RUN_SETUP },
+               { "receive-pack", cmd_receive_pack },
                { "reflog", cmd_reflog, RUN_SETUP },
                { "remote", cmd_remote, RUN_SETUP },
                { "repo-config", cmd_config },
@@ -341,7 +342,7 @@ static void handle_internal_command(int argc, const char **argv)
                { "shortlog", cmd_shortlog, USE_PAGER },
                { "show-branch", cmd_show_branch, RUN_SETUP },
                { "show", cmd_show, RUN_SETUP | USE_PAGER },
-               { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE | 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 },
@@ -418,7 +419,6 @@ int main(int argc, const char **argv)
 {
        const char *cmd = argv[0] && *argv[0] ? argv[0] : "git-help";
        char *slash = (char *)cmd + strlen(cmd);
-       const char *cmd_path = NULL;
        int done_alias = 0;
 
        /*
@@ -431,7 +431,7 @@ int main(int argc, const char **argv)
        while (cmd <= slash && !is_dir_sep(*slash));
        if (cmd <= slash) {
                *slash++ = 0;
-               cmd_path = cmd;
+               git_set_argv0_path(cmd);
                cmd = slash;
        }
 
@@ -475,7 +475,7 @@ int main(int argc, const char **argv)
         * environment, and the $(gitexecdir) from the Makefile at build
         * time.
         */
-       setup_path(cmd_path);
+       setup_path();
 
        while (1) {
                /* See if it's an internal command */
@@ -500,7 +500,9 @@ int main(int argc, const char **argv)
                                cmd, argv[0]);
                        exit(1);
                }
-               help_unknown_cmd(cmd);
+               argv[0] = help_unknown_cmd(cmd);
+               handle_internal_command(argc, argv);
+               execv_dashed_external(argv);
        }
 
        fprintf(stderr, "Failed to run command '%s': %s\n",