diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-03-30 17:04:01 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-30 21:16:56 +0200 |
commit | 690eb057198275b314b776688240fcc7f9e789d0 (patch) | |
tree | 50803b2fc6cd19c8dc82a60e262505b0f189fafe /builtin/multi-pack-index.c | |
parent | builtin/multi-pack-index.c: split sub-commands (diff) | |
download | git-690eb057198275b314b776688240fcc7f9e789d0.tar.xz git-690eb057198275b314b776688240fcc7f9e789d0.zip |
builtin/multi-pack-index.c: don't enter bogus cmd_mode
Even before the recent refactoring, 'git multi-pack-index' calls
'trace2_cmd_mode()' before verifying that the sub-command is recognized.
Push this call down into the individual sub-commands so that we don't
enter a bogus command mode.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rw-r--r-- | builtin/multi-pack-index.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c index a78640c061..b590c4fc88 100644 --- a/builtin/multi-pack-index.c +++ b/builtin/multi-pack-index.c @@ -63,6 +63,8 @@ static int cmd_multi_pack_index_write(int argc, const char **argv) { struct option *options = common_opts; + trace2_cmd_mode(argv[0]); + argc = parse_options(argc, argv, NULL, options, builtin_multi_pack_index_write_usage, PARSE_OPT_KEEP_UNKNOWN); @@ -77,6 +79,8 @@ static int cmd_multi_pack_index_verify(int argc, const char **argv) { struct option *options = common_opts; + trace2_cmd_mode(argv[0]); + argc = parse_options(argc, argv, NULL, options, builtin_multi_pack_index_verify_usage, PARSE_OPT_KEEP_UNKNOWN); @@ -91,6 +95,8 @@ static int cmd_multi_pack_index_expire(int argc, const char **argv) { struct option *options = common_opts; + trace2_cmd_mode(argv[0]); + argc = parse_options(argc, argv, NULL, options, builtin_multi_pack_index_expire_usage, PARSE_OPT_KEEP_UNKNOWN); @@ -112,6 +118,8 @@ static int cmd_multi_pack_index_repack(int argc, const char **argv) options = add_common_options(builtin_multi_pack_index_repack_options); + trace2_cmd_mode(argv[0]); + argc = parse_options(argc, argv, NULL, options, builtin_multi_pack_index_repack_usage, @@ -147,8 +155,6 @@ int cmd_multi_pack_index(int argc, const char **argv, usage_with_options(builtin_multi_pack_index_usage, builtin_multi_pack_index_options); - trace2_cmd_mode(argv[0]); - if (!strcmp(argv[0], "repack")) return cmd_multi_pack_index_repack(argc, argv); else if (!strcmp(argv[0], "write")) |