use status --ignore-submodules in configureSmudgeFilter

Speed up git-annex upgrade (from v5) and init in a repository that has
submodules. Setting the config does not affect the submodules, so avoid
the work of getting status in them, which may involve using the smudge
filter etc.

Sponsored-By: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
Joey Hess 2022-12-20 16:02:42 -04:00
parent 0b2dd374d8
commit eb8e0594bb
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 21 additions and 1 deletions

View file

@ -29,7 +29,11 @@ configureSmudgeFilter = unlessM (fromRepo Git.repoIsLocalBare) $ do
-- unexpected changes when the file is checked into git or annex
-- counter to the annex.largefiles configuration.
-- Avoid that problem by running git status now.
inRepo $ Git.Command.runQuiet [Param "status", Param "--porcelain"]
inRepo $ Git.Command.runQuiet
[ Param "status"
, Param "--porcelain"
, Param "--ignore-submodules"
]
setConfig (ConfigKey "filter.annex.smudge") "git-annex smudge -- %f"
setConfig (ConfigKey "filter.annex.clean") "git-annex smudge --clean -- %f"