Skip to content

Commit 58c58c8

Browse files
committed
Merge branch 'jc/maint-rebase-rewrite-last-skip' into maint
* jc/maint-rebase-rewrite-last-skip: rebase --skip: correctly wrap-up when skipping the last patch
2 parents 2f73969 + ef88ad2 commit 58c58c8

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

git-am.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,13 +577,6 @@ then
577577
resume=
578578
fi
579579

580-
if test "$this" -gt "$last"
581-
then
582-
say Nothing to do.
583-
rm -fr "$dotest"
584-
exit
585-
fi
586-
587580
while test "$this" -le "$last"
588581
do
589582
msgnum=`printf "%0${prec}d" $this`

t/t5407-post-rewrite-hook.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ test_expect_success 'setup' '
1010
test_commit A foo A &&
1111
test_commit B foo B &&
1212
test_commit C foo C &&
13-
test_commit D foo D
13+
test_commit D foo D &&
14+
git checkout A^0 &&
15+
test_commit E bar E &&
16+
test_commit F foo F &&
17+
git checkout master
1418
'
1519

1620
mkdir .git/hooks
@@ -79,6 +83,18 @@ EOF
7983
verify_hook_input
8084
'
8185

86+
test_expect_success 'git rebase --skip the last one' '
87+
git reset --hard F &&
88+
clear_hook_input &&
89+
test_must_fail git rebase --onto D A &&
90+
git rebase --skip &&
91+
echo rebase >expected.args &&
92+
cat >expected.data <<EOF &&
93+
$(git rev-parse E) $(git rev-parse HEAD)
94+
EOF
95+
verify_hook_input
96+
'
97+
8298
test_expect_success 'git rebase -m' '
8399
git reset --hard D &&
84100
clear_hook_input &&

0 commit comments

Comments
 (0)