diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2023-04-10 11:08:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-10 18:53:19 +0200 |
commit | fb60b9f37f87241a886e183f0ec6261debb9c1c5 (patch) | |
tree | 8d99df1e8a7adf0045021ef5283bf9a4c4cc696d /builtin/prune.c | |
parent | rebase: stop reading and writing unnecessary strategy state (diff) | |
download | git-fb60b9f37f87241a886e183f0ec6261debb9c1c5.tar.xz git-fb60b9f37f87241a886e183f0ec6261debb9c1c5.zip |
sequencer: use struct strvec to store merge strategy options
The sequencer stores the merge strategy options in an array of strings
which allocated with ALLOC_GROW(). Using "struct strvec" avoids manually
managing the memory of that array and simplifies the code.
Aside from memory allocation the changes to the sequencer are largely
mechanical, changing xopts_nr to xopts.nr and xopts[i] to xopts.v[i]. A
new option parsing macro OPT_STRVEC() is also added to collect the
strategy options. Hopefully this can be used to simplify the code in
builtin/merge.c in the future.
Note that there is a change of behavior to "git cherry-pick" and "git
revert" as passing “--no-strategy-option” will now clear any previous
strategy options whereas before this change it did nothing.
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/prune.c')
0 files changed, 0 insertions, 0 deletions