run git status before enabling clean filter

Avoids annex.largefiles inconsitency and also avoids a lot of
unneccessary calls to the clean filter when a large repo's clone
is being initialized.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2018-08-28 10:26:51 -04:00
parent 82b28a8487
commit 401a79675b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 65 additions and 18 deletions

View file

@ -0,0 +1,21 @@
[[!comment format=mdwn
username="joey"
subject="""comment 13"""
date="2018-08-28T14:02:37Z"
content="""
However, that leaves the case where .gitattributes configures
annex.largefiles, but that's been overridden for a file to add it to git,
and then the repo is cloned and initted with --version=6 (or upgraded).
Turns out that calling git status before enabling the smudge filter
prevents git from getting confused about the file being modified in this
case.
In the fresh clone, git has not populated the index with stat info
yet, and so it later runs the clean filter on the file, and that
respects the largefiles configuration, so the way the file is
stored in git is not taken into account.
Worked around this by adding a `git status` call to the v6
initialization/upgrade.
"""]]