Skip to content

Commit a7167ae

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. Note: the test t3404 had to be adjusted because the the error messages produced by the sequencer comply with our current convention to start with a lower-case letter. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent be15aaa commit a7167ae

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

git-rebase--interactive.sh

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

10691069
case "$action" in
10701070
continue)
1071+
if test ! -d "$rewritten"
1072+
then
1073+
exec git rebase--helper ${force_rebase:+--no-ff} --continue
1074+
fi
10711075
# do we have anything to commit?
10721076
if git diff-index --cached --quiet HEAD --
10731077
then
@@ -1127,6 +1131,10 @@ first and then run 'git rebase --continue' again.")"
11271131
skip)
11281132
git rerere clear
11291133

1134+
if test ! -d "$rewritten"
1135+
then
1136+
exec git rebase--helper ${force_rebase:+--no-ff} --continue
1137+
fi
11301138
do_rest
11311139
return 0
11321140
;;
@@ -1313,6 +1321,11 @@ expand_todo_ids
13131321
test -d "$rewritten" || test -n "$force_rebase" || skip_unnecessary_picks
13141322

13151323
checkout_onto
1324+
if test -z "$rebase_root" && test ! -d "$rewritten"
1325+
then
1326+
require_clean_work_tree "rebase"
1327+
exec git rebase--helper ${force_rebase:+--no-ff} --continue
1328+
fi
13161329
do_rest
13171330

13181331
}

t/t3404-rebase-interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ test_expect_success 'clean error after failed "exec"' '
556556
echo "edited again" > file7 &&
557557
git add file7 &&
558558
test_must_fail git rebase --continue 2>error &&
559-
test_i18ngrep "You have staged changes in your working tree." error
559+
test_i18ngrep "you have staged changes in your working tree" error
560560
'
561561

562562
test_expect_success 'rebase a detached HEAD' '

0 commit comments

Comments
 (0)