refactoring

Moving argument parsing to before Annex monad code
is a first step toward letting argument parsing set
AnnexRead values, which are immutable inside that monad.
This commit is contained in:
Joey Hess 2021-04-06 12:22:56 -04:00
parent b57dde2590
commit b4de4b2589
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -52,13 +52,14 @@ dispatch' subcommandname args fuzzy cmds allargs allcmds fields getgitrepo progn
go =<< tryNonAsync getgitrepo
where
go (Right g) = do
state <- Annex.new g
g' <- Git.Config.read g
(cmd, seek, globalconfig) <- parsewith False cmdparser
(\a -> a (Just g'))
O.handleParseResult
state <- Annex.new g'
Annex.eval state $ do
checkEnvironment
forM_ fields $ uncurry Annex.setField
(cmd, seek, globalconfig) <- parsewith False cmdparser
(\a -> inRepo $ a . Just)
(liftIO . O.handleParseResult)
prepRunCommand cmd globalconfig
startup
performCommandAction cmd seek $