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

[PATCH v4 25/29] tests: t3440: test --trailer without values

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

Added a regression test to ensure git
rebase --trailer accepts trailers without
values while preserving the separator’s
trailing space in the recorded message.

Signed-off-by: Li Chen <redacted>
---
 t/t3440-rebase-trailer.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/t/t3440-rebase-trailer.sh b/t/t3440-rebase-trailer.sh
index 36f11f579e..df121efd0e 100755
--- a/t/t3440-rebase-trailer.sh
+++ b/t/t3440-rebase-trailer.sh
@@ -50,6 +50,16 @@ test_expect_success 'reject trailer with missing key before separator' '
 	test_grep "missing key before separator" err
 '
 
+test_expect_success 'allow trailer with missing value after separator' '
+	git rebase -m --trailer "Acked-by:" HEAD~1 third &&
+	cat >expect <<-\EOF &&
+	third
+
+	Acked-by: 
+	EOF
+	test_commit_message HEAD expect
+'
+
 test_expect_success 'CLI trailer duplicates allowed; replace policy keeps last' '
 	git -c trailer.Bug.ifexists=replace -c trailer.Bug.ifmissing=add \
 		rebase -m --trailer "Bug: 123" --trailer "Bug: 456" HEAD~1 third &&
-- 
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