work around strange auto-init bug

git-annex get when run as the first git-annex command in a new repo did not
populate unlocked files. (Reversion in version 8.20210621)

I am not entirely happy with this, because I don't understand how
428c91606b caused the problem in the first
place, and I don't fully understand how skipping calling scanAnnexedFiles
during autoinit avoids the problem.

Kept the explicit call to scanAnnexedFiles during git-annex init,
so that when reconcileStaged is expensive, it can be made to run then,
rather than at some later point when the information is needed.

Sponsored-by: Brock Spratlen on Patreon
This commit is contained in:
Joey Hess 2021-07-30 18:36:03 -04:00
parent 9f94d2894e
commit b3c4579c79
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
9 changed files with 33 additions and 20 deletions

View file

@ -58,10 +58,10 @@ ifAnnexed file yes no = maybe no yes =<< lookupKey file
- Normally the keys database is updated incrementally when it's being
- opened, and changes are noticed. Calling this explicitly allows
- running the update at an earlier point.
-
- All that needs to be done is to open the database,
- that will result in Database.Keys.reconcileStaged
- running, and doing the work.
-}
scanAnnexedFiles :: Annex ()
scanAnnexedFiles =
-- All that needs to be done is to open the database,
-- that will result in Database.Keys.reconcileStaged
-- running, and doing the work.
Database.Keys.runWriter (const noop)
scanAnnexedFiles = Database.Keys.runWriter (const noop)