aboutsummaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-12 16:20:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-12 16:20:41 -0400
commit603e01e96ce8d76f4b689b4503c3f4528c39957f (patch)
tree9ed444ab384ab587f40cd03941a40cb22fc9c4d1 /Annex.hs
parent20acda0423b1a00eae64296835679887ca79ea2f (diff)
simplify some function signatures using state
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Annex.hs b/Annex.hs
index 78d990eac..1752cabff 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -2,7 +2,6 @@
-}
module Annex (
- State,
startAnnex,
annexFile,
unannexFile,
@@ -45,12 +44,12 @@ startAnnex = do
- the annex directory and setting up the symlink pointing to its content. -}
annexFile :: State -> FilePath -> IO ()
annexFile state file = do
- alreadyannexed <- lookupBackend (backends state) state file
+ alreadyannexed <- lookupBackend state file
case (alreadyannexed) of
Just _ -> error $ "already annexed: " ++ file
Nothing -> do
checkLegal file
- stored <- storeFile (backends state) state file
+ stored <- storeFile state file
case (stored) of
Nothing -> error $ "no backend could store: " ++ file
Just key -> symlink key
@@ -70,11 +69,11 @@ annexFile state file = do
{- Inverse of annexFile. -}
unannexFile :: State -> FilePath -> IO ()
unannexFile state file = do
- alreadyannexed <- lookupBackend (backends state) state file
+ alreadyannexed <- lookupBackend state file
case (alreadyannexed) of
Nothing -> error $ "not annexed " ++ file
Just _ -> do
- mkey <- dropFile (backends state) state file
+ mkey <- dropFile state file
case (mkey) of
Nothing -> return ()
Just key -> do
@@ -86,7 +85,7 @@ unannexFile state file = do
{- Transfers the file from a remote. -}
annexGetFile :: State -> FilePath -> IO ()
annexGetFile state file = do
- alreadyannexed <- lookupBackend (backends state) state file
+ alreadyannexed <- lookupBackend state file
case (alreadyannexed) of
Nothing -> error $ "not annexed " ++ file
Just _ -> do error "not implemented" -- TODO