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
F15424038: D21192.diff
Sat, Mar 22, 7:58 PM
F15408882: D21192.id.diff
Wed, Mar 19, 2:05 AM
F15405044: D21192.id50470.diff
Tue, Mar 18, 10:05 AM
F15336613: D21192.diff
Sat, Mar 8, 7:53 PM
F15332705: D21192.diff
Fri, Mar 7, 7:23 PM
F15316058: D21192.diff
Thu, Mar 6, 6:20 PM
F15311741: D21192.id50469.diff
Thu, Mar 6, 10:38 AM
F15294297: D21192.id.diff
Wed, Mar 5, 7:07 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