static const char *opt_commit;
static const char *opt_edit;
static const char *cleanup_arg;
-static const char *opt_ff;
+static char *opt_ff;
static const char *opt_verify_signatures;
static const char *opt_verify;
static int opt_autostash = -1;
* "--rebase" can override a config setting of
* pull.ff=only.
*/
- if (opt_rebase >= 0 && opt_ff && !strcmp(opt_ff, "--ff-only"))
- opt_ff = "--ff";
+ if (opt_rebase >= 0 && opt_ff && !strcmp(opt_ff, "--ff-only")) {
+ free(opt_ff);
+ opt_ff = xstrdup("--ff");
+ }
}
if (opt_rebase < 0)
if (can_ff) {
/* we can fast-forward this without invoking rebase */
- opt_ff = "--ff-only";
+ free(opt_ff);
+ opt_ff = xstrdup("--ff-only");
ret = run_merge();
} else {
ret = run_rebase(&newbase, &upstream);