117
struct string_list exec;
118
int allow_empty_message;
119
int rebase_merges, rebase_cousins;
120
- char *strategy, *strategy_opts;
120
+ char *strategy;
121
+ struct string_list strategy_opts;
122
struct strbuf git_format_patch_opt;
123
int reschedule_failed_exec;
124
int reapply_cherry_picks;
144
.config_autosquash = -1, \
145
.update_refs = -1, \
146
.config_update_refs = -1, \
147
+ .strategy_opts = STRING_LIST_INIT_NODUP,\
148
}
149
150
static struct replay_opts get_replay_opts(const struct rebase_options *opts)
178
replay.default_strategy = NULL;
179
}
180
179
- if (opts->strategy_opts)
180
- parse_strategy_opts(&replay, opts->strategy_opts);
181
+ for (size_t i = 0; i < opts->strategy_opts.nr; i++)
182
+ strvec_push(&replay.xopts, opts->strategy_opts.items[i].string);
183
184
if (opts->squash_onto) {
185
oidcpy(&replay.squash_onto, opts->squash_onto);
1015
int ignore_whitespace = 0;
1016
const char *gpg_sign = NULL;
1017
const char *rebase_merges = NULL;
1016
- struct string_list strategy_options = STRING_LIST_INIT_NODUP;
1018
struct object_id squash_onto;
1019
char *squash_onto_name = NULL;
1020
char *keep_base_onto_name = NULL;
1123
N_("use 'merge-base --fork-point' to refine upstream")),
1124
OPT_STRING('s', "strategy", &options.strategy,
1125
N_("strategy"), N_("use the given merge strategy")),
1125
- OPT_STRING_LIST('X', "strategy-option", &strategy_options,
1126
+ OPT_STRING_LIST('X', "strategy-option", &options.strategy_opts,
1127
N_("option"),
1128
N_("pass the argument through to the merge "
1129
"strategy")),
1437
} else {
1438
/* REBASE_MERGE */
1439
if (ignore_whitespace) {
1439
- string_list_append(&strategy_options,
1440
+ string_list_append(&options.strategy_opts,
1441
"ignore-space-change");
1442
}
1443
}
1444
1444
- if (strategy_options.nr) {
1445
- int i;
1446
-
1447
- if (!options.strategy)
1448
- options.strategy = "ort";
1449
-
1450
- strbuf_reset(&buf);
1451
- for (i = 0; i < strategy_options.nr; i++)
1452
- strbuf_addf(&buf, " --%s",
1453
- strategy_options.items[i].string);
1454
- options.strategy_opts = xstrdup(buf.buf);
1455
- }
1445
+ if (options.strategy_opts.nr && !options.strategy)
1446
+ options.strategy = "ort";
1447
1448
if (options.strategy) {
1449
options.strategy = xstrdup(options.strategy);
1818
free(options.gpg_sign_opt);
1819
string_list_clear(&options.exec, 0);
1820
free(options.strategy);
1830
- free(options.strategy_opts);
1821
+ string_list_clear(&options.strategy_opts, 0);
1822
strbuf_release(&options.git_format_patch_opt);
1823
free(squash_onto_name);
1824
free(keep_base_onto_name);
1834
- string_list_clear(&strategy_options, 0);
1825
return !!ret;
1826
}