diff --git a/Makefile b/Makefile index a1d8775adb..ebc1a57cd4 100644 --- a/Makefile +++ b/Makefile @@ -642,7 +642,6 @@ PROGRAM_OBJS += http-backend.o PROGRAM_OBJS += imap-send.o PROGRAM_OBJS += sh-i18n--envsubst.o PROGRAM_OBJS += shell.o -PROGRAM_OBJS += show-index.o PROGRAM_OBJS += upload-pack.o PROGRAM_OBJS += remote-testsvn.o @@ -1019,6 +1018,7 @@ BUILTIN_OBJS += builtin/rm.o BUILTIN_OBJS += builtin/send-pack.o BUILTIN_OBJS += builtin/shortlog.o BUILTIN_OBJS += builtin/show-branch.o +BUILTIN_OBJS += builtin/show-index.o BUILTIN_OBJS += builtin/show-ref.o BUILTIN_OBJS += builtin/stripspace.o BUILTIN_OBJS += builtin/submodule--helper.o diff --git a/builtin.h b/builtin.h index 42378f3aa4..feb559e582 100644 --- a/builtin.h +++ b/builtin.h @@ -218,6 +218,7 @@ extern int cmd_send_pack(int argc, const char **argv, const char *prefix); extern int cmd_shortlog(int argc, const char **argv, const char *prefix); extern int cmd_show(int argc, const char **argv, const char *prefix); extern int cmd_show_branch(int argc, const char **argv, const char *prefix); +extern int cmd_show_index(int argc, const char **argv, const char *prefix); extern int cmd_status(int argc, const char **argv, const char *prefix); extern int cmd_stripspace(int argc, const char **argv, const char *prefix); extern int cmd_submodule__helper(int argc, const char **argv, const char *prefix); 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..a6e678809e 100644 --- a/show-index.c +++ b/builtin/show-index.c @@ -1,10 +1,11 @@ +#include "builtin.h" #include "cache.h" #include "pack.h" 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 ceaa58ef40..1a10c96375 100644 --- a/git.c +++ b/git.c @@ -464,6 +464,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 }, { "show-ref", cmd_show_ref, RUN_SETUP }, { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE }, { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },