Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--help.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/help.c b/help.c
index 41c41c2aa1..7e594d291b 100644
--- a/help.c
+++ b/help.c
@@ -44,13 +44,19 @@ static struct category_description main_categories[] = {
static const char *drop_prefix(const char *name, uint32_t category)
{
const char *new_name;
+ const char *prefix = NULL;
if (skip_prefix(name, "git-", &new_name))
return new_name;
- if (category == CAT_guide && skip_prefix(name, "git", &new_name))
+ switch (category) {
+ case CAT_guide:
+ prefix = "git";
+ break;
+ }
+ if (prefix && skip_prefix(name, prefix, &new_name))
return new_name;
- return name;
+ return name;
}
static void extract_cmds(struct cmdname_help **p_cmds, uint32_t mask)