summaryrefslogtreecommitdiff
path: root/Logs/Location.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Logs/Location.hs')
-rw-r--r--Logs/Location.hs11
1 files changed, 5 insertions, 6 deletions
diff --git a/Logs/Location.hs b/Logs/Location.hs
index 8855cf63b..602c46f31 100644
--- a/Logs/Location.hs
+++ b/Logs/Location.hs
@@ -29,16 +29,15 @@ import Logs.Presence
{- 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
- | null u = error $
- "unknown UUID for " ++ Git.repoDescribe repo ++
- " (have you run git annex init there?)"
- | otherwise = addLog (logFile key) =<< logNow s u
+logChange _ key (UUID u) s = addLog (logFile key) =<< logNow s u
+logChange repo _ NoUUID _ = error $
+ "unknown UUID for " ++ Git.repoDescribe repo ++
+ " (have you run git annex init there?)"
{- Returns a list of repository UUIDs that, according to the log, have
- the value of a key. -}
keyLocations :: Key -> Annex [UUID]
-keyLocations = currentLog . logFile
+keyLocations key = map read <$> (currentLog . logFile) key
{- Finds all keys that have location log information.
- (There may be duplicate keys in the list.) -}