Improve startup time for commands that do not operate on remotes
And for tab completion, by not unnessessarily statting paths to remotes, which used to cause eg, spin-up of removable drives. Got rid of the remotes member of Git.Repo. This was a bit painful. Remote.Git modifies the list of remotes as it reads their configs, so still need a persistent list of remotes. So, put it in as Annex.gitremotes. It's only populated by getGitRemotes, so commands like examinekey that don't care about remotes won't do so. This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
parent
d0fe4d7308
commit
2b66492d6e
22 changed files with 148 additions and 70 deletions
|
@ -11,7 +11,6 @@ module Git.Repair (
|
|||
removeBadBranches,
|
||||
successfulRepair,
|
||||
cleanCorruptObjects,
|
||||
retrieveMissingObjects,
|
||||
resetLocalBranches,
|
||||
checkIndex,
|
||||
checkIndexFast,
|
||||
|
@ -102,10 +101,11 @@ retrieveMissingObjects missing referencerepo r
|
|||
unlessM (boolSystem "git" [Param "init", File tmpdir]) $
|
||||
error $ "failed to create temp repository in " ++ tmpdir
|
||||
tmpr <- Config.read =<< Construct.fromAbsPath tmpdir
|
||||
stillmissing <- pullremotes tmpr (remotes r) fetchrefstags missing
|
||||
rs <- Construct.fromRemotes r
|
||||
stillmissing <- pullremotes tmpr rs fetchrefstags missing
|
||||
if S.null (knownMissing stillmissing)
|
||||
then return stillmissing
|
||||
else pullremotes tmpr (remotes r) fetchallrefs stillmissing
|
||||
else pullremotes tmpr rs fetchallrefs stillmissing
|
||||
where
|
||||
pullremotes tmpr [] fetchrefs stillmissing = case referencerepo of
|
||||
Nothing -> return stillmissing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue