Page MenuHomePhabricator

Restore the ":(attr:filter=lfs)" test for LFS
ClosedPublic

Authored by epriestley on Apr 30 2020, 4:01 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Mar 10, 12:24 AM
Unknown Object (File)
Feb 4 2024, 12:09 AM
Unknown Object (File)
Jan 11 2024, 12:03 PM
Unknown Object (File)
Jan 7 2024, 8:03 AM
Unknown Object (File)
Dec 31 2023, 8:21 AM
Unknown Object (File)
Dec 25 2023, 3:52 AM
Unknown Object (File)
Dec 24 2023, 8:45 PM
Unknown Object (File)
Dec 23 2023, 1:39 AM
Subscribers

Details

Summary

See D21190. The ".gitattributes" approach fails when ".gitattributes" is in a subdirectory (or global). These are probably unusual cases, but at least one is known in the wild.

Instead:

  • Restore the ":(attr:filter=lfs)" test, which seems to be the fastest accurate test available in modern Git.
  • If the test fails, assume the repository is not LFS. This only impacts users running very old versions of Git.
Test Plan
  • In LFS and non-LFS repositories, created diffs. Saw correct detection again.
  • Broke the command on purpose, saw LFS detection conclude "no LFS", but not fail disastrously.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable