Thread (43 messages) 43 messages, 3 authors, 2025-11-03
STALE239d
Revisions (2)
  1. v4 current
  2. v5 [diff vs current]

[PATCH v4 17/29] tests: t3440: create expect files at point of use

From: Li Chen <hidden>
Date: 2025-10-14 12:27:49
Subsystem: the rest · Maintainer: Linus Torvalds

Created the expected trailer files within
the individual rebase tests that use them,
simplifying the shared history setup and
avoiding unused fixtures.

Signed-off-by: Li Chen <redacted>
---
 t/t3440-rebase-trailer.sh | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/t/t3440-rebase-trailer.sh b/t/t3440-rebase-trailer.sh
index c08a9c4abf..0c0185d058 100755
--- a/t/t3440-rebase-trailer.sh
+++ b/t/t3440-rebase-trailer.sh
@@ -26,14 +26,7 @@ test_expect_success 'setup repo with a small history' '
 	git checkout -b conflict-branch first &&
 	test_commit file-2 file-2 &&
 	test_commit conflict file &&
-	test_commit third file &&
-	ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" &&
-	create_expect initial-signed  "Initial empty commit" &&
-	create_expect first-signed    "first"                 &&
-	create_expect second-signed   "second"                &&
-	create_expect file2-signed    "file-2"                &&
-	create_expect third-signed    "third"                 &&
-	create_expect conflict-signed "conflict"
+	test_commit third file
 '
 
 test_expect_success 'apply backend is rejected with --trailer' '
@@ -74,6 +67,7 @@ test_expect_success 'multiple Signed-off-by trailers all preserved' '
 '
 
 test_expect_success 'rebase -m --trailer adds trailer after conflicts' '
+	create_expect file2-signed "file-2" &&
 	git reset --hard third &&
 	test_must_fail git rebase -m \
 		--trailer "Reviewed-by: Dev <dev@example.com>" \
@@ -85,6 +79,8 @@ test_expect_success 'rebase -m --trailer adds trailer after conflicts' '
 '
 
 test_expect_success 'rebase --root --trailer updates every commit' '
+	create_expect initial-signed "Initial empty commit" &&
+	create_expect first-signed "first" &&
 	git checkout first &&
 	git rebase --root --keep-empty \
 		--trailer "Reviewed-by: Dev <dev@example.com>" &&
-- 
2.51.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help