project: Set config option to skip lfs smudge filter

During sync, repo runs `git read-tree --reset -u -v HEAD` which causes
git-lfs's smudge filter to run. However this fails because git-lfs does
not work with bare repositories.

Add lfs.filter configuration to the project config as suggested in the
comments on the upstream git-lfs client issue [1]. This prevents the
smudge filter from running, and the sync completes successfully.

For any projects that have LFS objects, `git lfs pull` must be executed.

[1] https://github.com/github/git-lfs/issues/1422

Bug: Issue 224
Change-Id: I091ff37998131e2e6bbc59aa37ee352fe12d7fcd
This commit is contained in:
David Pursehouse 2016-08-16 12:11:12 +09:00
parent befaec1e56
commit 76a4a9df86

View File

@ -2235,6 +2235,7 @@ class Project(object):
for key in ['user.name', 'user.email']: for key in ['user.name', 'user.email']:
if m.Has(key, include_defaults=False): if m.Has(key, include_defaults=False):
self.config.SetString(key, m.GetString(key)) self.config.SetString(key, m.GetString(key))
self.config.SetString('filter.lfs.smudge', 'git-lfs smudge --skip -- %f')
if self.manifest.IsMirror: if self.manifest.IsMirror:
self.config.SetString('core.bare', 'true') self.config.SetString('core.bare', 'true')
else: else: