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
F15506260: D21192.id50469.diff
Tue, Apr 15, 9:50 AM
F15490073: D21192.diff
Fri, Apr 11, 2:04 PM
F15490033: D21192.id.diff
Fri, Apr 11, 2:03 PM
F15490011: D21192.id50470.diff
Fri, Apr 11, 2:03 PM
F15490002: D21192.id50469.diff
Fri, Apr 11, 2:03 PM
F15474442: D21192.diff
Sun, Apr 6, 8:43 AM
F15458533: D21192.id50469.diff
Mon, Mar 31, 4:24 AM
F15454717: D21192.id50470.diff
Sat, Mar 29, 7:56 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