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:
parent
b57dde2590
commit
b4de4b2589
1 changed files with 5 additions and 4 deletions
|
@ -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 $
|
||||
|
|
Loading…
Reference in a new issue