Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mihaigalos opened this issue Oct 11, 2023 · 1 comment
Open

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

mihaigalos opened this issue Oct 11, 2023 · 1 comment

Comments

@mihaigalos
Copy link

mihaigalos commented Oct 11, 2023

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?

@Mikaela
Copy link

Mikaela commented Oct 11, 2023

I think your steps are missing git add .gitattributes && git commit after git lfs track ...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants