]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/rebase.c
Merge branch 'pw/rebase-reflog-fixes'
[thirdparty/git.git] / builtin / rebase.c
index d5e684a7cec17b60907a06383f26101bfaee1a2f..5d855fd8f51ffe95cde24012e3bed4398b54f85a 100644 (file)
@@ -122,6 +122,7 @@ struct rebase_options {
        int reschedule_failed_exec;
        int reapply_cherry_picks;
        int fork_point;
+       int update_refs;
 };
 
 #define REBASE_OPTIONS_INIT {                          \
@@ -300,7 +301,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
                ret = complete_action(the_repository, &replay, flags,
                        shortrevisions, opts->onto_name, opts->onto,
                        &opts->orig_head->object.oid, &commands,
-                       opts->autosquash, &todo_list);
+                       opts->autosquash, opts->update_refs, &todo_list);
        }
 
        string_list_clear(&commands, 0);
@@ -804,6 +805,11 @@ static int rebase_config(const char *var, const char *value, void *data)
                return 0;
        }
 
+       if (!strcmp(var, "rebase.updaterefs")) {
+               opts->update_refs = git_config_bool(var, value);
+               return 0;
+       }
+
        if (!strcmp(var, "rebase.reschedulefailedexec")) {
                opts->reschedule_failed_exec = git_config_bool(var, value);
                return 0;
@@ -1115,6 +1121,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
                OPT_BOOL(0, "autosquash", &options.autosquash,
                         N_("move commits that begin with "
                            "squash!/fixup! under -i")),
+               OPT_BOOL(0, "update-refs", &options.update_refs,
+                        N_("update branches that point to commits "
+                           "that are being rebased")),
                { OPTION_STRING, 'S', "gpg-sign", &gpg_sign, N_("key-id"),
                        N_("GPG-sign commits"),
                        PARSE_OPT_OPTARG, NULL, (intptr_t) "" },