diff options
author | 2011-09-28 02:35:23 -0400 | |
---|---|---|
committer | 2011-09-28 02:35:23 -0400 | |
commit | 1c9c9a0cee33b63e9147863b95e570a8cc349304 (patch) | |
tree | f8de8957ec52d52bf07171c252c6626348d910cd /LocationLog.hs | |
parent | 7724f895a810d5922fb0581403ff17169344f514 (diff) |
golfing
Diffstat (limited to 'LocationLog.hs')
-rw-r--r-- | LocationLog.hs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/LocationLog.hs b/LocationLog.hs index fa660c8b6..7e5e81d7a 100644 --- a/LocationLog.hs +++ b/LocationLog.hs @@ -23,7 +23,6 @@ module LocationLog ( ) where import System.FilePath -import Control.Monad (when) import Control.Applicative import Data.Maybe @@ -36,16 +35,16 @@ import PresenceLog {- Log a change in the presence of a key's value in a repository. -} logChange :: Git.Repo -> Key -> UUID -> LogStatus -> Annex () -logChange repo key u s = do - when (null u) $ - error $ "unknown UUID for " ++ Git.repoDescribe repo ++ - " (have you run git annex init there?)" - addLog (logFile key) =<< logNow s u +logChange repo key u s + | null u = error $ + "unknown UUID for " ++ Git.repoDescribe repo ++ + " (have you run git annex init there?)" + | otherwise = addLog (logFile key) =<< logNow s u {- Returns a list of repository UUIDs that, according to the log, have - the value of a key. -} keyLocations :: Key -> Annex [UUID] -keyLocations key = currentLog $ logFile key +keyLocations = currentLog . logFile {- Finds all keys that have location log information. - (There may be duplicate keys in the list.) -} |