summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-10 21:00:42 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-10 21:00:42 -0400
commit200bc6fdb84658593bfb02f34f984531b6710d26 (patch)
tree7361961de5e90c8be6d1a56010214304cdd18659 /Annex.hs
parent344f13394fe5b12cbdd5eeb99bb63892c7096bfd (diff)
better option handling
multiple-file support for all modes
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs12
1 files changed, 3 insertions, 9 deletions
diff --git a/Annex.hs b/Annex.hs
index 964532f3f..ee94a9809 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -25,15 +25,14 @@ startAnnex = do
- the annex directory and setting up the symlink pointing to its content. -}
annexFile :: State -> FilePath -> IO ()
annexFile state file = do
- checkExists file
- checkLegal file
alreadyannexed <- lookupBackend (backends state) (repo state) file
case (alreadyannexed) of
- Just _ -> error $ "already annexed " ++ file
+ Just _ -> error $ "already annexed: " ++ file
Nothing -> do
+ checkLegal file
stored <- storeFile (backends state) (repo state) file
case (stored) of
- Nothing -> error $ "no backend could store " ++ file
+ Nothing -> error $ "no backend could store: " ++ file
Just key -> symlink key
where
symlink key = do
@@ -42,11 +41,6 @@ annexFile state file = do
renameFile file dest
createSymbolicLink dest file
gitAdd (repo state) file
- checkExists file = do
- exists <- doesFileExist file
- if (not exists)
- then error $ "does not exist: " ++ file
- else return ()
checkLegal file = do
s <- getSymbolicLinkStatus file
if ((isSymbolicLink s) || (not $ isRegularFile s))