From: Li Chen Date: Wed, 22 Oct 2025 05:39:45 GMT Subject: [PATCH v5 25/29] t3440: test --trailer without values Message-ID: <20251022053951.602605-26-me@linux.beauty> In-Reply-To: <20251022053951.602605-1-me@linux.beauty> Add 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 --- 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 4b0b0ee2d3..bed6955001 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 && + sed -e "s/_/ /g" <<-\EOF >expect && + 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