This commit is contained in:
Joey Hess 2011-06-02 02:40:43 -04:00
parent f2cc87860c
commit bcb72ce0f2
3 changed files with 6 additions and 9 deletions

View file

@ -28,8 +28,8 @@ import Messages
import UUID import UUID
{- Runs the passed command line. -} {- Runs the passed command line. -}
dispatch :: Git.Repo -> [String] -> [Command] -> [Option] -> String -> IO () dispatch :: [String] -> [Command] -> [Option] -> String -> Git.Repo -> IO ()
dispatch gitrepo args cmds options header = do dispatch args cmds options header gitrepo = do
setupConsole setupConsole
state <- Annex.new gitrepo allBackends state <- Annex.new gitrepo allBackends
(actions, state') <- Annex.run state $ parseCmd args header cmds options (actions, state') <- Annex.run state $ parseCmd args header cmds options

View file

@ -113,6 +113,4 @@ header :: String
header = "Usage: git-annex command [option ..]" header = "Usage: git-annex command [option ..]"
run :: [String] -> IO () run :: [String] -> IO ()
run args = do run args = dispatch args cmds options header =<< Git.repoFromCwd
gitrepo <- Git.repoFromCwd
dispatch gitrepo args cmds options header

View file

@ -58,10 +58,9 @@ builtins :: [String]
builtins = map cmdname cmds builtins = map cmdname cmds
builtin :: String -> String -> [String] -> IO () builtin :: String -> String -> [String] -> IO ()
builtin cmd dir params = do builtin cmd dir params =
dir' <- Git.repoAbsPath dir Git.repoAbsPath dir >>= Git.repoFromAbsPath >>=
gitrepo <- Git.repoFromAbsPath dir' dispatch (cmd:(filterparams params)) cmds commonOptions header
dispatch gitrepo (cmd:(filterparams params)) cmds commonOptions header
external :: [String] -> IO () external :: [String] -> IO ()
external params = do external params = do