diff --git a/git.c b/git.c index ecda180344c192..ba75f690442ca2 100644 --- a/git.c +++ b/git.c @@ -876,7 +876,8 @@ int cmd_main(int argc, const char **argv) * that one cannot handle it. */ if (skip_prefix(cmd, "git-", &cmd)) { - warn_on_dashed_git(argv[0]); + strip_extension(&cmd); + warn_on_dashed_git(cmd); argv[0] = cmd; handle_builtin(argc, argv); diff --git a/help.c b/help.c index 4fb93d5560e31a..64573954169f7d 100644 --- a/help.c +++ b/help.c @@ -726,9 +726,12 @@ NORETURN void help_unknown_ref(const char *ref, const char *cmd, static struct cmdname_help *find_cmdname_help(const char *name) { int i; + const char *p; + skip_prefix(name, "git-", &name); for (i = 0; i < ARRAY_SIZE(command_list); i++) { - if (!strcmp(command_list[i].name, name)) + if (skip_prefix(command_list[i].name, "git-", &p) && + !strcmp(p, name)) return &command_list[i]; } return NULL;