Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2021-09-13 18:19:17 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-13 22:47:06 +0300
commit1e14bc11ed01e876809e62d2b13db71d6c0d265c (patch)
treeed6d0e05a35649859f1e281a6cd99cbe38574c09 /t/t3407-rebase-abort.sh
parent0b7ae738a6a166d3b60af68c9b0984971baa7718 (diff)
t3407: strengthen rebase --abort tests
The existing tests only check that HEAD points to the correct commit after aborting, they do not check that the original branch is checked out. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3407-rebase-abort.sh')
-rwxr-xr-xt/t3407-rebase-abort.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index 7eba9ec161..f8264449b6 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -19,6 +19,13 @@ test_expect_success setup '
test_commit "merge should fail on this, too" a e pre-rebase
'
+# Check that HEAD is equal to "pre-rebase" and the current branch is
+# "to-rebase"
+check_head() {
+ test_cmp_rev HEAD pre-rebase &&
+ test "$(git symbolic-ref HEAD)" = refs/heads/to-rebase
+}
+
testrebase() {
type=$1
state_dir=$2
@@ -29,7 +36,7 @@ testrebase() {
test_must_fail git rebase$type main &&
test_path_is_dir "$state_dir" &&
git rebase --abort &&
- test_cmp_rev to-rebase pre-rebase &&
+ check_head &&
test_path_is_missing "$state_dir"
'
@@ -41,7 +48,7 @@ testrebase() {
test_must_fail git rebase --skip &&
test_cmp_rev HEAD main &&
git rebase --abort &&
- test_cmp_rev to-rebase pre-rebase &&
+ check_head &&
test_path_is_missing "$state_dir"
'
@@ -56,7 +63,7 @@ testrebase() {
test_must_fail git rebase --continue &&
test_cmp_rev ! HEAD main &&
git rebase --abort &&
- test_cmp_rev to-rebase pre-rebase &&
+ check_head &&
test_path_is_missing "$state_dir"
'