diff mbox series

[02/11] t3407: use test_commit

Message ID 79b6dec910ecc9ceb61d03e3bbd9919ce457d78e.1631094563.git.gitgitgadget@gmail.com (mailing list archive)
State Superseded
Headers show
Series rebase: dereference tags | expand

Commit Message

Phillip Wood Sept. 8, 2021, 9:49 a.m. UTC
From: Phillip Wood <phillip.wood@dunelm.org.uk>

Simplify the setup by using test_commit. Note that this replaces the
branch "pre-rebase" with a tag of the same name. "pre-rebase" is only
used as a fixed reference point so it makes sense to use a tag rather
than a branch.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
 t/t3407-rebase-abort.sh | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

Comments

Ævar Arnfjörð Bjarmason Sept. 8, 2021, 10:39 a.m. UTC | #1
On Wed, Sep 08 2021, Phillip Wood via GitGitGadget wrote:

> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> Simplify the setup by using test_commit. Note that this replaces the
> branch "pre-rebase" with a tag of the same name. "pre-rebase" is only
> used as a fixed reference point so it makes sense to use a tag rather
> than a branch.

FWIW you could use --no-tag to test_commit to keep the behavior, but
changing it here seems fine.
diff mbox series

Patch

diff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh
index c747bd31d76..0ad21966bc5 100755
--- a/t/t3407-rebase-abort.sh
+++ b/t/t3407-rebase-abort.sh
@@ -8,22 +8,15 @@  export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 . ./test-lib.sh
 
 test_expect_success setup '
-	echo a > a &&
-	git add a &&
-	git commit -m a &&
+	test_commit a a a &&
 	git branch to-rebase &&
 
-	echo b > a &&
-	git commit -a -m b &&
-	echo c > a &&
-	git commit -a -m c &&
+	test_commit b a b &&
+	test_commit c a c &&
 
 	git checkout to-rebase &&
-	echo d > a &&
-	git commit -a -m "merge should fail on this" &&
-	echo e > a &&
-	git commit -a -m "merge should fail on this, too" &&
-	git branch pre-rebase
+	test_commit "merge should fail on this" a d d &&
+	test_commit "merge should fail on this, too" a e pre-rebase
 '
 
 testrebase() {