]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'fs/find-end-of-log-message-fix'
authorJunio C Hamano <gitster@pobox.com>
Thu, 21 Mar 2024 21:55:12 +0000 (14:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 21 Mar 2024 21:55:12 +0000 (14:55 -0700)
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

1  2 
t/t7513-interpret-trailers.sh
wt-status.c

index ec9c6de114fddfdb7127434ae17f3ae419164f6c,5efe70d675964086bdc0ddfd68ee55a711a13086..3d3e13ccf87215adc1f8dcc8cc674e13d0f4bc91
@@@ -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
diff --cc wt-status.c
Simple merge