Skip to content

Commit 5378808

Browse files
committed
rebase -i: use the rebase--helper builtin
Now that the sequencer learned to process a "normal" interactive rebase, we use it. The original shell script is still used for "non-normal" interactive rebases, i.e. when --root or --preserve-merges was passed. Please note that the --root option (via the $squash_onto variable) needs special handling only for the very first command, hence it is still okay to use the helper upon continue/skip. Also please note that the --no-ff setting is volatile, i.e. when the interactive rebase is interrupted at any stage, there is no record of it. Therefore, we have to pass it from the shell script to the rebase--helper. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 09ddfa5 commit 5378808

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

git-rebase--interactive.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,10 @@ git_rebase__interactive () {
10461046

10471047
case "$action" in
10481048
continue)
1049+
if test ! -d "$rewritten"
1050+
then
1051+
exec git rebase--helper ${force_rebase:+--no-ff} --continue
1052+
fi
10491053
# do we have anything to commit?
10501054
if git diff-index --cached --quiet HEAD --
10511055
then
@@ -1103,6 +1107,10 @@ first and then run 'git rebase --continue' again."
11031107
skip)
11041108
git rerere clear
11051109

1110+
if test ! -d "$rewritten"
1111+
then
1112+
exec git rebase--helper ${force_rebase:+--no-ff} --continue
1113+
fi
11061114
do_rest
11071115
return 0
11081116
;;
@@ -1291,6 +1299,11 @@ expand_todo_ids
12911299
test -d "$rewritten" || test -n "$force_rebase" || skip_unnecessary_picks
12921300

12931301
checkout_onto
1302+
if test -z "$rebase_root" && test ! -d "$rewritten"
1303+
then
1304+
require_clean_work_tree "rebase"
1305+
exec git rebase--helper ${force_rebase:+--no-ff} --continue
1306+
fi
12941307
do_rest
12951308

12961309
}

0 commit comments

Comments
 (0)