From: Junio C Hamano Date: Thu, 21 Mar 2024 21:55:12 +0000 (-0700) Subject: Merge branch 'fs/find-end-of-log-message-fix' X-Git-Tag: v2.45.0-rc0~93 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8be51c1f36e7891c2d9c934d9bb8a81970a0f04e;p=thirdparty%2Fgit.git Merge branch 'fs/find-end-of-log-message-fix' The code to find the effective end of log message can fall into an endless loop, which has been corrected. * fs/find-end-of-log-message-fix: wt-status: don't find scissors line beyond buf len --- 8be51c1f36e7891c2d9c934d9bb8a81970a0f04e diff --cc t/t7513-interpret-trailers.sh index ec9c6de114,5efe70d675..3d3e13ccf8 --- a/t/t7513-interpret-trailers.sh +++ b/t/t7513-interpret-trailers.sh @@@ -1916,23 -1476,18 +1916,37 @@@ test_expect_success 'suppress --- handl test_cmp expected actual ' +test_expect_success 'suppressing --- does not disable cut-line handling' ' + echo "real-trailer: before the cut" >expected && + + git interpret-trailers --parse --no-divider >actual <<-\EOF && + subject + + This input has a cut-line in it; we should stop parsing when we see it + and consider only trailers before that line. + + real-trailer: before the cut + + # ------------------------ >8 ------------------------ + # Nothing below this line counts as part of the commit message. + not-a-trailer: too late + EOF + + test_cmp expected actual +' + + test_expect_success 'handling of --- lines in conjunction with cut-lines' ' + echo "my-trailer: here" >expected && + + git interpret-trailers --parse >actual <<-\EOF && + subject + + my-trailer: here + --- + # ------------------------ >8 ------------------------ + EOF + + test_cmp expected actual + ' + test_done