Skip to content

Potential bug: forbid-binary with git-lfs #113

@mihaigalos

Description

@mihaigalos

Upstream issue: pre-commit/pre-commit#3028.

Summary

Tried to add a file to git lfs and this broke the forbid-binary hook.

Description

bash:

git lfs track "*.pdf"
git add foo.pdf && git commit -m "chore: Test LFS"

This now fails since the files are binary, even though they're stored as pointers:

Forbid binaries..........................................................Failed
- hook id: forbid-binary
- exit code: 1

Additional info

pre-commit --version
pre-commit 3.3.3

.pre-commit-config.yaml:

- repo: https://github.com/jumanjihouse/pre-commit-hooks
  rev: 3.0.0
  hooks:
  - id: forbid-binary

Proposed solution(s)

Maybe there's an easy fix around this, potentially even looking at .gitattributes?

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