summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-04-22 13:49:32 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-04-22 13:49:32 -0400
commitb48a044d26bb607da9962b9086e9da2db9e11620 (patch)
tree0a5b94be74befcbf51431ea4a0d7da31cbdcf357 /Logs
parent475f9475f162c1c1f9aee727fa3f3a471ebe2506 (diff)
reinject: Added new mode which can reinject known files into the annex.
For example: git-annex reinject --known /mnt/backup/*
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