summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Location.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Logs/Location.hs b/Logs/Location.hs
index 2698d7f95..ba2aed1b5 100644
--- a/Logs/Location.hs
+++ b/Logs/Location.hs
@@ -19,6 +19,7 @@ module Logs.Location (
logChange,
loggedLocations,
loggedLocationsHistorical,
+ isKnownKey,
checkDead,
setDead,
loggedKeys,
@@ -65,6 +66,13 @@ getLoggedLocations getter key = do
config <- Annex.getGitConfig
map toUUID <$> getter (locationLogFile config key)
+{- Is there a location log for the key? True even for keys with no
+ - remaining locations. -}
+isKnownKey :: Key -> Annex Bool
+isKnownKey key = do
+ config <- Annex.getGitConfig
+ not . null <$> readLog (locationLogFile config key)
+
{- For a key to be dead, all locations that have location status for the key
- must have InfoDead set. -}
checkDead :: Key -> Annex Bool