Skip to content

Trufflehog fails with TRUFFLEHOG_PRE_COMMIT if worktrees enabled #5181

Description

@marpulli

Please review the Community Note before submitting

TruffleHog Version

trufflehog 3.96.0

Trace Output

https://gist.github.com/marpulli/40b2d7831a25d6207d053a4465db264a

Expected Behavior

Not errored

Actual Behavior

Errored with encountered errors during scan {"job": 1, "source_name": "trufflehog - git", "errors": ["error chunking dir \".\": core.repositoryformatversion does not support extension: worktreeconfig"]}

Steps to Reproduce

Run trufflehog with TRUFFLEHOG_PRE_COMMIT=1 in a git repo with worktrees enabled. Full command I'm running is TRUFFLEHOG_PRE_COMMIT=1 trufflehog git file://. --no-update

Environment

  • OS: MacOS
  • Version 26.5.2

Additional Context

The issue seems to be that go-git doesn't support worktreeConfig = true setting in git config. Upstream issue is here - it looks like v6 will support it when released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions