branch -h: show usage even in an invalid repository
[gitweb.git] / builtin / branch.c
index 87976f0921d87f2a8564eb54aa3b81d30ee7f214..0e50556a151c186429e13d03fc8e279fa6ddecd5 100644 (file)
@@ -667,6 +667,9 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
                OPT_END(),
        };
 
+       if (argc == 2 && !strcmp(argv[1], "-h"))
+               usage_with_options(builtin_branch_usage, options);
+
        git_config(git_branch_config, NULL);
 
        if (branch_use_color == -1)