summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/help.c4
-rwxr-xr-xt/t0012-help.sh7
2 files changed, 10 insertions, 1 deletions
diff --git a/builtin/help.c b/builtin/help.c
index d0c9605..30f160a 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -559,6 +559,10 @@ int cmd_help(int argc, const char **argv, const char *prefix)
usage_msg_opt(_("--config and --all cannot be combined"),
builtin_help_usage, builtin_help_options);
+ if (show_all && show_guides)
+ usage_msg_opt(_("--config and --guides cannot be combined"),
+ builtin_help_usage, builtin_help_options);
+
if (show_config && show_guides)
usage_msg_opt(_("--config and --guides cannot be combined"),
builtin_help_usage, builtin_help_options);
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index b4ed622..69e385d 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -36,7 +36,12 @@ test_expect_success 'basic help commands' '
test_expect_success 'invalid usage' '
test_expect_code 129 git help -g add &&
- test_expect_code 129 git help -a -c
+ test_expect_code 129 git help -a -c &&
+
+ test_expect_code 129 git help -g add &&
+ test_expect_code 129 git help -a -g &&
+
+ test_expect_code 129 git help -g -c
'
test_expect_success "works for commands and guides by default" '