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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Feb 9, 2017 at 23:23 UTC 18633e1a22a68bbe8e6311a1039d13ebbf6fd041
2 files changed +14 -1
git-rebase--interactive.sh
+13
@@ -1069,6 +1069,10 @@ git_rebase__interactive () {
1069
1070 case "$action" in
1071 continue)
1072 + if test ! -d "$rewritten"
1073 + then
1074 + exec git rebase--helper ${force_rebase:+--no-ff} --continue
1075 + fi
1076 # do we have anything to commit?
1077 if git diff-index --cached --quiet HEAD --
1078 then
@@ -1128,6 +1132,10 @@ first and then run 'git rebase --continue' again.")"
1132 skip)
1133 git rerere clear
1134
1135 + if test ! -d "$rewritten"
1136 + then
1137 + exec git rebase--helper ${force_rebase:+--no-ff} --continue
1138 + fi
1139 do_rest
1140 return 0
1141 ;;
@@ -1314,6 +1322,11 @@ expand_todo_ids
1322 test -d "$rewritten" || test -n "$force_rebase" || skip_unnecessary_picks
1323
1324 checkout_onto
1325 +if test -z "$rebase_root" && test ! -d "$rewritten"
1326 +then
1327 + require_clean_work_tree "rebase"
1328 + exec git rebase--helper ${force_rebase:+--no-ff} --continue
1329 +fi
1330 do_rest
1331
1332 }
t/t3404-rebase-interactive.sh
+1 -1
@@ -556,7 +556,7 @@ test_expect_success 'clean error after failed "exec"' '
556 echo "edited again" > file7 &&
557 git add file7 &&
558 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
560 '
561
562 test_expect_success 'rebase a detached HEAD' '