@@ -21,6 +21,9 @@ rebase.autoStash::
`--autostash` options of linkgit:git-rebase[1].
Defaults to false.
+rebase.updateRefs::
+ If set to true enable `--update-refs` option by default.
+
rebase.missingCommitsCheck::
If set to "warn", git rebase -i will print a warning if some
commits are removed (e.g. a line was deleted), however the
@@ -615,6 +615,10 @@ start would be overridden by the presence of
are being rebased. Any branches that are checked out in a worktree
or point to a `squash! ...` or `fixup! ...` commit are not updated
in this way.
++
+If the `--update-refs` option is enabled by default using the
+configuration variable `rebase.updateRefs`, this option can be
+used to override and disable this setting.
INCOMPATIBLE OPTIONS
--------------------
@@ -802,6 +802,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;
@@ -1768,6 +1768,11 @@ test_expect_success '--update-refs adds git branch commands' '
exec git update-ref refs/heads/no-conflict-branch HEAD $(git rev-parse M)
EOF
+ test_cmp expect todo &&
+
+ test_must_fail git -c rebase.autosquash=true \
+ -c rebase.updaterefs=true \
+ rebase -i primary >todo &&
test_cmp expect todo
)
'