Skip to content

Commit de9f1d3

Browse files
agrngitster
authored andcommitted
t3432: test --merge' with rebase.abbreviateCommands = true', too
When fast forwarding, `git --merge' should act the same whether `rebase.abbreviateCommands' is set or not, but so far it was not the case. This duplicates the tests ensuring that `--merge' works when fast forwarding to check if it also works with abbreviated commands. Signed-off-by: Alban Gruin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 68e7090 commit de9f1d3

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

t/t3432-rebase-fast-forward.sh

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ test_rebase_same_head () {
2828
shift &&
2929
cmp_f="$1" &&
3030
shift &&
31-
test_rebase_same_head_ $status_n $what_n $cmp_n " --apply" "$*" &&
32-
test_rebase_same_head_ $status_f $what_f $cmp_f " --apply --no-ff" "$*"
33-
test_rebase_same_head_ $status_n $what_n $cmp_n " --merge" "$*" &&
34-
test_rebase_same_head_ $status_f $what_f $cmp_f " --merge --no-ff" "$*"
31+
test_rebase_same_head_ $status_n $what_n $cmp_n 0 " --apply" "$*" &&
32+
test_rebase_same_head_ $status_f $what_f $cmp_f 0 " --apply --no-ff" "$*"
33+
test_rebase_same_head_ $status_n $what_n $cmp_n 0 " --merge" "$*" &&
34+
test_rebase_same_head_ $status_f $what_f $cmp_f 0 " --merge --no-ff" "$*"
35+
test_rebase_same_head_ $status_n $what_n $cmp_n 1 " --merge" "$*" &&
36+
test_rebase_same_head_ $status_f $what_f $cmp_f 1 " --merge --no-ff" "$*"
3537
}
3638

3739
test_rebase_same_head_ () {
@@ -41,9 +43,21 @@ test_rebase_same_head_ () {
4143
shift &&
4244
cmp="$1" &&
4345
shift &&
46+
abbreviate="$1" &&
47+
shift &&
4448
flag="$1"
4549
shift &&
46-
test_expect_$status "git rebase$flag $* with $changes is $what with $cmp HEAD" "
50+
if test $abbreviate -eq 1
51+
then
52+
msg="git rebase$flag $* (rebase.abbreviateCommands = true) with $changes is $what with $cmp HEAD"
53+
else
54+
msg="git rebase$flag $* with $changes is $what with $cmp HEAD"
55+
fi &&
56+
test_expect_$status "$msg" "
57+
if test $abbreviate -eq 1
58+
then
59+
test_config rebase.abbreviateCommands true
60+
fi &&
4761
oldhead=\$(git rev-parse HEAD) &&
4862
test_when_finished 'git reset --hard \$oldhead' &&
4963
cp .git/logs/HEAD expect &&

0 commit comments

Comments
 (0)