Closed
Description
Hello,
After upgrading from v3.4.0 to v4.2.0, the check-added-large-files
hook is now failing when used inside a worktree:
check for added large files............................................................Failed
- hook id: check-added-large-files
- exit code: 1
fatal: '/home/.../main-repo/.git/worktrees/worktree-repo/COMMIT_EDITMSG' is outside repository at '/home/.../worktree-repo'
Traceback (most recent call last):
File "/home/.../.cache/pre-commit/repo_kdm5un1/py_env-python3.10/bin/check-added-large-files", line 8, in <module>
sys.exit(main())
File "/home/.../.cache/pre-commit/repo_kdm5un1/py_env-python3.10/lib/python3.10/site-packages/pre_commit_hooks/check_added_large_files.py", line 73, in main
return find_large_added_files(
File "/home/.../.cache/pre-commit/repo_kdm5un1/py_env-python3.10/lib/python3.10/site-packages/pre_commit_hooks/check_added_large_files.py", line 43, in find_large_added_files
filter_lfs_files(filenames_filtered)
File "/home/.../.cache/pre-commit/repo_kdm5un1/py_env-python3.10/lib/python3.10/site-packages/pre_commit_hooks/check_added_large_files.py", line 18, in filter_lfs_files
check_attr = subprocess.run(
File "/home/.../.asdf/installs/python/3.10.4/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('git', 'check-attr', 'filter', '-z', '--stdin')' returned non-zero exit status 128.
I believe the regression comes from 03a65ca
Activity
check-added-large-files
#778asottile commentedon Jun 6, 2022
can you try the patch in #778 -- you can use
rev
to select that commit and see if it works!skyj commentedon Jun 7, 2022
Works fine, thank you 🙏
destroyed-symlinks
#1085