HomePhabricator

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

Description

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

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.

Subscribers: ptarjan

Differential Revision: https://secure.phabricator.com/D21192

Details

Provenance
epriestleyAuthored on Apr 30 2020, 3:54 AM
epriestleyPushed on Apr 30 2020, 4:04 AM
Differential Revision
D21192: Restore the ":(attr:filter=lfs)" test for LFS
Parents
rARCade9b51a1fd9: Detect LFS by looking for tracks in ".gitattributes" instead of using "ls-tree"
Branches
Unknown
Tags
Unknown
Build Status
Buildable 24285
Build 33453: Run Core Tests