HomePhabricator

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

Description

(stable) 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
rARCf05ff652152a: (stable) Detect LFS by looking for tracks in ".gitattributes" instead of using…
Branches
Unknown
Tags
Unknown
Build Status
Buildable 24286
Build 33454: Run Core Tests