]> git.ipfire.org Git - thirdparty/git.git/blobdiff - help.c
help.c: remove common category behavior from drop_prefix() behavior
[thirdparty/git.git] / help.c
diff --git a/help.c b/help.c
index 7e594d291b0b9caec480d15867b47547cbb8d429..8a09f18a3d91ea5ed1234722960c217372d48883 100644 (file)
--- a/help.c
+++ b/help.c
@@ -44,16 +44,17 @@ 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;
+       const char *prefix;
 
-       if (skip_prefix(name, "git-", &new_name))
-               return new_name;
        switch (category) {
        case CAT_guide:
                prefix = "git";
                break;
+       default:
+               prefix = "git-";
+               break;
        }
-       if (prefix && skip_prefix(name, prefix, &new_name))
+       if (skip_prefix(name, prefix, &new_name))
                return new_name;
 
        return name;