aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/am.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-01-16 13:35:51 -0800
committerJunio C Hamano <gitster@pobox.com>2025-01-17 13:30:03 -0800
commitb821c999ca5cb472160a2ebb33aeeac5efc2fddc (patch)
tree955f0eb05d2c883356831122bd8667b4f7d05c78 /builtin/am.c
parentusage: add show_usage_if_asked() (diff)
downloadgit-b821c999ca5cb472160a2ebb33aeeac5efc2fddc.tar.gz
git-b821c999ca5cb472160a2ebb33aeeac5efc2fddc.zip
builtins: send usage_with_options() help text to standard output
Using the show_usage_with_options_if_asked() helper we introduced earlier, fix callers of usage_with_options() that want to show the help text when explicitly asked by the end-user. The help text now goes to the standard output stream for them. The test in t7600 for "git merge -h" may want to be retired, as the same is covered by t0012 already, but it is specifically testing that the "-h" option gets a response even with a corrupt index file, so for now let's leave it there. Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
-rw-r--r--builtin/am.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/am.c b/builtin/am.c
index 1338b606fe..8d8f38fa1d 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2427,8 +2427,7 @@ int cmd_am(int argc,
OPT_END()
};
- if (argc == 2 && !strcmp(argv[1], "-h"))
- usage_with_options(usage, options);
+ show_usage_with_options_if_asked(argc, argv, usage, options);
git_config(git_default_config, NULL);