Skip to content

git secrets --list returns wrong result if there's a branch with name ending with secrets #159

Open
@HASHIMOTO-Takafumi

Description

@HASHIMOTO-Takafumi

When there's secrets branch for example, .git/config may contains the following lines:

[branch "secrets"]
        remote = origin
        merge = refs/heads/secrets

If so, git secrets --list returns these config incorrectly:

$ git secrets --list
branch.secrets.remote origin
branch.secrets.merge refs/heads/secrets
...

It seems to be caused by the following regexes:

git-secrets/git-secrets

Lines 340 to 343 in 5e28df3

if [ ${GLOBAL} -eq 1 ]; then
git config --global --get-regex secrets.*
else
git config --get-regex secrets.*

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