git.c: consistently use the term "builtin" instead of "internal command"
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index cb5208de6a5aab7c222a1d1655fe37089a119fe0..89ab5d7421cf49e141cfe39d428796e6e638434b 100644 (file)
--- a/git.c
+++ b/git.c
@@ -54,7 +54,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                /*
                 * Check remaining flags.
                 */
-               if (!prefixcmp(cmd, "--exec-path")) {
+               if (starts_with(cmd, "--exec-path")) {
                        cmd += 11;
                        if (*cmd == '=')
                                git_set_argv_exec_path(cmd + 1);
@@ -92,7 +92,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                                *envchanged = 1;
                        (*argv)++;
                        (*argc)--;
-               } else if (!prefixcmp(cmd, "--git-dir=")) {
+               } else if (starts_with(cmd, "--git-dir=")) {
                        setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
                        if (envchanged)
                                *envchanged = 1;
@@ -106,7 +106,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                                *envchanged = 1;
                        (*argv)++;
                        (*argc)--;
-               } else if (!prefixcmp(cmd, "--namespace=")) {
+               } else if (starts_with(cmd, "--namespace=")) {
                        setenv(GIT_NAMESPACE_ENVIRONMENT, cmd + 12, 1);
                        if (envchanged)
                                *envchanged = 1;
@@ -120,7 +120,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
                                *envchanged = 1;
                        (*argv)++;
                        (*argc)--;
-               } else if (!prefixcmp(cmd, "--work-tree=")) {
+               } else if (starts_with(cmd, "--work-tree=")) {
                        setenv(GIT_WORK_TREE_ENVIRONMENT, cmd + 12, 1);
                        if (envchanged)
                                *envchanged = 1;
@@ -332,7 +332,7 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
        return 0;
 }
 
-static void handle_internal_command(int argc, const char **argv)
+static void handle_builtin(int argc, const char **argv)
 {
        const char *cmd = argv[0];
        static struct cmd_struct commands[] = {
@@ -408,7 +408,6 @@ static void handle_internal_command(int argc, const char **argv)
                { "pack-redundant", cmd_pack_redundant, RUN_SETUP },
                { "pack-refs", cmd_pack_refs, RUN_SETUP },
                { "patch-id", cmd_patch_id },
-               { "peek-remote", cmd_ls_remote, RUN_SETUP_GENTLY },
                { "pickaxe", cmd_blame, RUN_SETUP },
                { "prune", cmd_prune, RUN_SETUP },
                { "prune-packed", cmd_prune_packed, RUN_SETUP },
@@ -421,7 +420,6 @@ static void handle_internal_command(int argc, const char **argv)
                { "remote-fd", cmd_remote_fd },
                { "repack", cmd_repack, RUN_SETUP },
                { "replace", cmd_replace, RUN_SETUP },
-               { "repo-config", cmd_repo_config, RUN_SETUP_GENTLY },
                { "rerere", cmd_rerere, RUN_SETUP },
                { "reset", cmd_reset, RUN_SETUP },
                { "rev-list", cmd_rev_list, RUN_SETUP },
@@ -438,7 +436,6 @@ static void handle_internal_command(int argc, const char **argv)
                { "stripspace", cmd_stripspace },
                { "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
                { "tag", cmd_tag, RUN_SETUP },
-               { "tar-tree", cmd_tar_tree },
                { "unpack-file", cmd_unpack_file, RUN_SETUP },
                { "unpack-objects", cmd_unpack_objects, RUN_SETUP },
                { "update-index", cmd_update_index, RUN_SETUP },
@@ -520,8 +517,8 @@ static int run_argv(int *argcp, const char ***argv)
        int done_alias = 0;
 
        while (1) {
-               /* See if it's an internal command */
-               handle_internal_command(*argcp, *argv);
+               /* See if it's a builtin */
+               handle_builtin(*argcp, *argv);
 
                /* .. then try the external ones */
                execv_dashed_external(*argv);
@@ -566,14 +563,14 @@ int main(int argc, char **av)
         *  - cannot execute it externally (since it would just do
         *    the same thing over again)
         *
-        * So we just directly call the internal command handler, and
-        * die if that one cannot handle it.
+        * So we just directly call the builtin handler, and die if
+        * that one cannot handle it.
         */
-       if (!prefixcmp(cmd, "git-")) {
+       if (starts_with(cmd, "git-")) {
                cmd += 4;
                argv[0] = cmd;
-               handle_internal_command(argc, argv);
-               die("cannot handle %s internally", cmd);
+               handle_builtin(argc, argv);
+               die("cannot handle %s as a builtin", cmd);
        }
 
        /* Look for flags.. */
@@ -581,7 +578,7 @@ int main(int argc, char **av)
        argc--;
        handle_options(&argv, &argc, NULL);
        if (argc > 0) {
-               if (!prefixcmp(argv[0], "--"))
+               if (starts_with(argv[0], "--"))
                        argv[0] += 2;
        } else {
                /* The user didn't specify a command; give them help */