diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-01-16 13:35:51 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-01-17 13:30:03 -0800 |
| commit | b821c999ca5cb472160a2ebb33aeeac5efc2fddc (patch) | |
| tree | 955f0eb05d2c883356831122bd8667b4f7d05c78 /builtin/merge.c | |
| parent | 0148fd836a9b1954833471f61b4d2e058797af55 (diff) | |
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/merge.c')
| -rw-r--r-- | builtin/merge.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index 5f67007bba..ba9faf126a 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1300,8 +1300,8 @@ int cmd_merge(int argc, void *branch_to_free; int orig_argc = argc; - if (argc == 2 && !strcmp(argv[1], "-h")) - usage_with_options(builtin_merge_usage, builtin_merge_options); + show_usage_with_options_if_asked(argc, argv, + builtin_merge_usage, builtin_merge_options); prepare_repo_settings(the_repository); the_repository->settings.command_requires_full_index = 0; |
