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 <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Alban Gruin committed
Mar 30, 2020 at 14:42 UTC
de9f1d3ef45ec885339d04f9e34293eb2de8605d
1 file changed
+19
-5
t/t3432-rebase-fast-forward.sh
+19
-5
@@ -28,10 +28,12 @@ test_rebase_same_head () {
28
shift &&
29
cmp_f="$1" &&
30
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" "$*"
37
}
38
39
test_rebase_same_head_ () {
@@ -41,9 +43,21 @@ test_rebase_same_head_ () {
43
shift &&
44
cmp="$1" &&
45
shift &&
46
+ abbreviate="$1" &&
47
+ shift &&
48
flag="$1"
49
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 &&
61
oldhead=\$(git rev-parse HEAD) &&
62
test_when_finished 'git reset --hard \$oldhead' &&
63
cp .git/logs/HEAD expect &&