-
-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Description
check-added-large-files hook doesn't correctly detect files in LFS when running with option --all-files
Using git cat-file -s :$file
would be a better implementation in order to get size of a blob.
For example:
$ grep gif .gitattributes
*.gif filter=lfs diff=lfs merge=lfs -text
$ pre-commit run check-added-large-files --all-files
Check for added large files..............................................Failed
- hook id: check-added-large-files
- exit code: 1
avatar1.gif (1770 KB) exceeds 1024 KB.
$ git cat-file blob :avatar1.gif
version https://git-lfs.github.com/spec/v1
oid sha256:b506867cbae90bcb984fbdfdbfd06ac15b2f1bb2077741d2100552de2c0859b7
size 1812444
$ git cat-file -s :avatar1.gif
132
Metadata
Metadata
Assignees
Labels
No labels