summaryrefslogtreecommitdiffstats
path: root/parse-options-cb.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-18 03:05:13 +0200
committerJunio C Hamano <gitster@pobox.com>2023-04-18 03:05:13 +0200
commit3c957e6d399452897209d90fc0528a77bb093df3 (patch)
tree9db9f2a1e962349bf90b350bf2d5244185fcfcb3 /parse-options-cb.c
parentMerge branch 'cm/branch-delete-error-message-update' (diff)
parentrebase: remove a couple of redundant strategy tests (diff)
downloadgit-3c957e6d399452897209d90fc0528a77bb093df3.tar.xz
git-3c957e6d399452897209d90fc0528a77bb093df3.zip
Merge branch 'pw/rebase-cleanup-merge-strategy-option-handling'
Clean-up of the code path that deals with merge strategy option handling in "git rebase". * pw/rebase-cleanup-merge-strategy-option-handling: rebase: remove a couple of redundant strategy tests rebase -m: fix serialization of strategy options rebase -m: cleanup --strategy-option handling sequencer: use struct strvec to store merge strategy options rebase: stop reading and writing unnecessary strategy state
Diffstat (limited to 'parse-options-cb.c')
-rw-r--r--parse-options-cb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/parse-options-cb.c b/parse-options-cb.c
index 2488e6c030..10f2f75e83 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -210,6 +210,22 @@ int parse_opt_string_list(const struct option *opt, const char *arg, int unset)
return 0;
}
+int parse_opt_strvec(const struct option *opt, const char *arg, int unset)
+{
+ struct strvec *v = opt->value;
+
+ if (unset) {
+ strvec_clear(v);
+ return 0;
+ }
+
+ if (!arg)
+ return -1;
+
+ strvec_push(v, arg);
+ return 0;
+}
+
int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset)
{
return 0;