|
|
a98108 |
From de9f1d3ef45ec885339d04f9e34293eb2de8605d Mon Sep 17 00:00:00 2001
|
|
|
a98108 |
From: Alban Gruin <alban.gruin@gmail.com>
|
|
|
a98108 |
Date: Mon, 30 Mar 2020 14:42:36 +0200
|
|
|
a98108 |
Subject: [PATCH 2/2] t3432: test `--merge' with `rebase.abbreviateCommands =
|
|
|
a98108 |
true', too
|
|
|
a98108 |
|
|
|
a98108 |
When fast forwarding, `git --merge' should act the same whether
|
|
|
a98108 |
`rebase.abbreviateCommands' is set or not, but so far it was not the
|
|
|
a98108 |
case. This duplicates the tests ensuring that `--merge' works when fast
|
|
|
a98108 |
forwarding to check if it also works with abbreviated commands.
|
|
|
a98108 |
|
|
|
a98108 |
Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
|
|
|
a98108 |
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
|
|
a98108 |
---
|
|
|
a98108 |
t/t3432-rebase-fast-forward.sh | 24 +++++++++++++++++++-----
|
|
|
a98108 |
1 file changed, 19 insertions(+), 5 deletions(-)
|
|
|
a98108 |
|
|
|
a98108 |
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
|
|
|
a98108 |
index 6c9d4a1375..6f0452c0ea 100755
|
|
|
a98108 |
--- a/t/t3432-rebase-fast-forward.sh
|
|
|
a98108 |
+++ b/t/t3432-rebase-fast-forward.sh
|
|
|
a98108 |
@@ -28,10 +28,12 @@ test_rebase_same_head () {
|
|
|
a98108 |
shift &&
|
|
|
a98108 |
cmp_f="$1" &&
|
|
|
a98108 |
shift &&
|
|
|
a98108 |
- test_rebase_same_head_ $status_n $what_n $cmp_n " --apply" "$*" &&
|
|
|
a98108 |
- test_rebase_same_head_ $status_f $what_f $cmp_f " --apply --no-ff" "$*"
|
|
|
a98108 |
- test_rebase_same_head_ $status_n $what_n $cmp_n " --merge" "$*" &&
|
|
|
a98108 |
- test_rebase_same_head_ $status_f $what_f $cmp_f " --merge --no-ff" "$*"
|
|
|
a98108 |
+ test_rebase_same_head_ $status_n $what_n $cmp_n 0 " --apply" "$*" &&
|
|
|
a98108 |
+ test_rebase_same_head_ $status_f $what_f $cmp_f 0 " --apply --no-ff" "$*"
|
|
|
a98108 |
+ test_rebase_same_head_ $status_n $what_n $cmp_n 0 " --merge" "$*" &&
|
|
|
a98108 |
+ test_rebase_same_head_ $status_f $what_f $cmp_f 0 " --merge --no-ff" "$*"
|
|
|
a98108 |
+ test_rebase_same_head_ $status_n $what_n $cmp_n 1 " --merge" "$*" &&
|
|
|
a98108 |
+ test_rebase_same_head_ $status_f $what_f $cmp_f 1 " --merge --no-ff" "$*"
|
|
|
a98108 |
}
|
|
|
a98108 |
|
|
|
a98108 |
test_rebase_same_head_ () {
|
|
|
a98108 |
@@ -41,9 +43,21 @@ test_rebase_same_head_ () {
|
|
|
a98108 |
shift &&
|
|
|
a98108 |
cmp="$1" &&
|
|
|
a98108 |
shift &&
|
|
|
a98108 |
+ abbreviate="$1" &&
|
|
|
a98108 |
+ shift &&
|
|
|
a98108 |
flag="$1"
|
|
|
a98108 |
shift &&
|
|
|
a98108 |
- test_expect_$status "git rebase$flag $* with $changes is $what with $cmp HEAD" "
|
|
|
a98108 |
+ if test $abbreviate -eq 1
|
|
|
a98108 |
+ then
|
|
|
a98108 |
+ msg="git rebase$flag $* (rebase.abbreviateCommands = true) with $changes is $what with $cmp HEAD"
|
|
|
a98108 |
+ else
|
|
|
a98108 |
+ msg="git rebase$flag $* with $changes is $what with $cmp HEAD"
|
|
|
a98108 |
+ fi &&
|
|
|
a98108 |
+ test_expect_$status "$msg" "
|
|
|
a98108 |
+ if test $abbreviate -eq 1
|
|
|
a98108 |
+ then
|
|
|
a98108 |
+ test_config rebase.abbreviateCommands true
|
|
|
a98108 |
+ fi &&
|
|
|
a98108 |
oldhead=\$(git rev-parse HEAD) &&
|
|
|
a98108 |
test_when_finished 'git reset --hard \$oldhead' &&
|
|
|
a98108 |
cp .git/logs/HEAD expect &&
|
|
|
a98108 |
--
|
|
|
a98108 |
2.26.0
|