]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sequencer.c
cherry-pick: add `--empty` for more robust redundant commit handling
[thirdparty/git.git] / sequencer.c
index 1964977545391c55c28879258429b1f9e2d44772..879b8ba2c0046be99609ec5bb8e48e7a46b1b928 100644 (file)
@@ -2932,6 +2932,9 @@ static int populate_opts_cb(const char *key, const char *value,
        else if (!strcmp(key, "options.allow-empty-message"))
                opts->allow_empty_message =
                        git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
+       else if (!strcmp(key, "options.drop-redundant-commits"))
+               opts->drop_redundant_commits =
+                       git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
        else if (!strcmp(key, "options.keep-redundant-commits"))
                opts->keep_redundant_commits =
                        git_config_bool_or_int(key, value, ctx->kvi, &error_flag);
@@ -3476,6 +3479,9 @@ static int save_opts(struct replay_opts *opts)
        if (opts->allow_empty_message)
                res |= git_config_set_in_file_gently(opts_file,
                                "options.allow-empty-message", "true");
+       if (opts->drop_redundant_commits)
+               res |= git_config_set_in_file_gently(opts_file,
+                               "options.drop-redundant-commits", "true");
        if (opts->keep_redundant_commits)
                res |= git_config_set_in_file_gently(opts_file,
                                "options.keep-redundant-commits", "true");