[PATCH v5 27/29] t3440: ensure trailers persist after rebase continue

Li Chen
2025-10-22T05:44:55Z

Rebuilt the conflict test branch, added a fourth commit,
and asserted that both the conflicted and subsequent commits
receive the --trailer data in t/t3440-rebase-trailer.sh.

Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
---
t/t3440-rebase-trailer.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/t/t3440-rebase-trailer.sh b/t/t3440-rebase-trailer.sh
index bea98d08c6..35d2054716 100755
--- a/t/t3440-rebase-trailer.sh
+++ b/t/t3440-rebase-trailer.sh
@@ -85,13 +85,16 @@ test_expect_success 'multiple Signed-off-by trailers all preserved' '
'

test_expect_success 'rebase -m --trailer adds trailer after conflicts' '
+ git checkout -B conflict-branch third &&
+ test_commit fourth file &&
test_must_fail git rebase -m \
- --trailer "$REVIEWED_BY_TRAILER" \
- second third &&
+ --trailer "$REVIEWED_BY_TRAILER" \
+ second &&
git checkout --theirs file &&
git add file &&
git rebase --continue &&
- expect_trailer_msg HEAD "third"
+ expect_trailer_msg HEAD "fourth" &&
+ expect_trailer_msg HEAD^ "third"
'

test_expect_success 'rebase --root --trailer updates every commit' '
--
2.51.0