avoid redundant prompt for http password in git-annex get that does autoinit

autoEnableSpecialRemotes runs a subprocess, and if the uuid for a git
remote has not been probed yet, that will do a http get that will prompt
for a password. And then the parent process will subsequently prompt
for a password when getting annexed files from the remote.

So the solution is for autoEnableSpecialRemotes to run remoteList before
the subprocess, which will probe for the uuid for the git remote in the
same process that will later be used to get annexed files.

But, Remote.Git imports Annex.Init, and Remote.List imports Remote.Git,
so Annex.Init cannot import Remote.List. Had to pass remoteList into
functions in Annex.Init to get around this dependency loop.
This commit is contained in:
Joey Hess 2022-09-09 14:43:43 -04:00
parent 9621beabc4
commit c62fe5e9a8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 44 additions and 13 deletions

View file

@ -16,6 +16,7 @@ import Config.Files.AutoStart
import qualified BuildInfo
import Utility.HumanTime
import Assistant.Install
import Remote.List
import Control.Concurrent.Async
@ -62,7 +63,7 @@ start o
stop
| otherwise = do
liftIO ensureInstalled
ensureInitialized
ensureInitialized remoteList
Command.Watch.start True (daemonOptions o) (startDelayOption o)
startNoRepo :: AssistantOptions -> IO ()