Skip to content

---- in commit message breaks trailer parsing #6760

@robertlacroix

Description

@robertlacroix

git_message_trailers fails to return trailers when the commit message contains 3 or more dashes, because find_patch_start erroneously just looks for --- instead of --- (with a trailing space, like Git does).

Reproduction steps

Try to parse trailers from a commit message like

Commit title

Header
------
Lorem ipsum

Signed-off-by: test@test.com

Expected behavior

git_message_trailers returns Signed-off-by trailer

Actual behavior

git_message_trailers returns no trailers

Version of libgit2 (release number or SHA1)

1.7.2 (a418d9d)

Operating system(s) tested

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions