Jeff King <[email protected]> writes:
> diff --git a/show-index.c b/builtin/show-index.c
> similarity index 96%
> rename from show-index.c
> rename to builtin/show-index.c
> index 1ead41e211..65fa86dd08 100644
> --- a/show-index.c
> +++ b/builtin/show-index.c
> @@ -4,7 +4,7 @@
I squashed
#include "builtin.h"
near the beginning of this file to squelch -DDEVELOPER extra
warnings. Otherwise looks obviously good.
> static const char show_index_usage[] =
> "git show-index";
>
> -int cmd_main(int argc, const char **argv)
> +int cmd_show_index(int argc, const char **argv, const char *prefix)
> {
> int i;
> unsigned nr;
> diff --git a/git.c b/git.c
> index 5771d62a32..c91e144d9a 100644
> --- a/git.c
> +++ b/git.c
> @@ -470,6 +470,7 @@ static struct cmd_struct commands[] = {
> { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
> { "show", cmd_show, RUN_SETUP },
> { "show-branch", cmd_show_branch, RUN_SETUP },
> + { "show-index", cmd_show_index },
Hmph, this does not need SETUP? Ah, of course, because its
subcommand body used to do everything itself, and this patch just
turns cmd_main() to cmd_show_index().
> { "show-ref", cmd_show_ref, RUN_SETUP },
> { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
> { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },