Open mihaigalos opened 1 year ago
Upstream issue: https://github.com/pre-commit/pre-commit/issues/3028.
Tried to add a file to git lfs and this broke the forbid-binary hook.
forbid-binary
bash:
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
pre-commit --version pre-commit 3.3.3
.pre-commit-config.yaml:
.pre-commit-config.yaml
- repo: https://github.com/jumanjihouse/pre-commit-hooks rev: 3.0.0 hooks: - id: forbid-binary
Maybe there's an easy fix around this, potentially even looking at .gitattributes?
I think your steps are missing git add .gitattributes && git commit after git lfs track ...?
git add .gitattributes && git commit
git lfs track ...
Upstream issue: https://github.com/pre-commit/pre-commit/issues/3028.
Summary
Tried to add a file to git lfs and this broke the
forbid-binary
hook.Description
bash
:This now fails since the files are binary, even though they're stored as pointers:
Additional info
.pre-commit-config.yaml
:Proposed solution(s)
Maybe there's an easy fix around this, potentially even looking at .gitattributes?