rename some stuff and prepare to break out more into Command/*

This commit is contained in:
Joey Hess 2010-12-30 14:19:16 -04:00
parent 14d59b40fb
commit 6a5be9d53c
24 changed files with 176 additions and 158 deletions

View file

@ -17,21 +17,21 @@ import qualified Command.Fix
{- The pre-commit hook needs to fix symlinks to all files being committed.
- And, it needs to inject unlocked files into the annex. -}
seek :: [SubCmdSeek]
seek :: [CommandSeek]
seek = [withFilesToBeCommitted Command.Fix.start,
withFilesUnlockedToBeCommitted start]
start :: SubCmdStartBackendFile
start :: CommandStartBackendFile
start pair = return $ Just $ perform pair
perform :: BackendFile -> SubCmdPerform
perform :: BackendFile -> CommandPerform
perform pair@(file, _) = do
ok <- doSubCmd $ Command.Add.start pair
ok <- doCommand $ Command.Add.start pair
if ok
then return $ Just $ cleanup file
else error $ "failed to add " ++ file ++ "; canceling commit"
cleanup :: FilePath -> SubCmdCleanup
cleanup :: FilePath -> CommandCleanup
cleanup file = do
-- git commit will have staged the file's content;
-- drop that and run command queued by Add.state to