diff options
author | Taylor Blau <me@ttaylorr.com> | 2021-03-30 15:03:57 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-03-30 19:16:56 (GMT) |
commit | 60ca94769ce45161c4bcfb4aa92212585d3da0f6 (patch) | |
tree | f33b4feb4c095483ec09147eb20bcb004d97a77a /alloc.h | |
parent | b25b727494f4782c7af1db31fdfde1cc9b30f7c4 (diff) | |
download | git-60ca94769ce45161c4bcfb4aa92212585d3da0f6.zip git-60ca94769ce45161c4bcfb4aa92212585d3da0f6.tar.gz git-60ca94769ce45161c4bcfb4aa92212585d3da0f6.tar.bz2 |
builtin/multi-pack-index.c: split sub-commands
Handle sub-commands of the 'git multi-pack-index' builtin (e.g.,
"write", "repack", etc.) separately from one another. This allows
sub-commands with unique options, without forcing cmd_multi_pack_index()
to reject invalid combinations itself.
This comes at the cost of some duplication and boilerplate. Luckily, the
duplication is reduced to a minimum, since common options are shared
among sub-commands due to a suggestion by Ævar. (Sub-commands do have to
retain the common options, too, since this builtin accepts common
options on either side of the sub-command).
Roughly speaking, cmd_multi_pack_index() parses options (including
common ones), and stops at the first non-option, which is the
sub-command. It then dispatches to the appropriate sub-command, which
parses the remaining options (also including common options).
Unknown options are kept by the sub-commands in order to detect their
presence (and complain that too many arguments were given).
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'alloc.h')
0 files changed, 0 insertions, 0 deletions