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
F18744729: D21192.id50469.diff
Fri, Oct 3, 3:58 AM
F18734276: D21192.id.diff
Tue, Sep 30, 10:51 PM
F18726771: D21192.id.diff
Tue, Sep 30, 7:12 AM
F18721348: D21192.diff
Mon, Sep 29, 8:57 PM
F18717859: D21192.id50470.diff
Mon, Sep 29, 2:34 PM
F18655294: D21192.diff
Mon, Sep 22, 7:38 PM
F18646860: D21192.id.diff
Fri, Sep 19, 11:19 AM
F18622152: D21192.diff
Sep 15 2025, 10:37 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