Skip to content

Commit 7879ead

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 <johannes.schindelin@gmx.de>
1 parent 202e7be commit 7879ead

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

git-rebase--interactive.sh

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

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

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

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

12951308
}

0 commit comments

Comments
 (0)