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