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)
Wed, May 21, 7:04 AM
Unknown Object (File)
Thu, May 15, 1:36 AM
Unknown Object (File)
Mon, May 5, 5:25 PM
Unknown Object (File)
Apr 29 2025, 5:59 PM
Unknown Object (File)
Apr 28 2025, 8:59 PM
Unknown Object (File)
Apr 15 2025, 9:50 AM
Unknown Object (File)
Apr 11 2025, 2:04 PM
Unknown Object (File)
Apr 11 2025, 2:03 PM
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