summaryrefslogtreecommitdiff
path: root/Command/Fsck.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-05-10 13:20:45 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-05-10 13:20:45 -0400
commit0bf6de3a9173898b47df1ae7e211c29740f1be1c (patch)
treeb29ee0544c861b1febd6c26753de0159c04a2bc8 /Command/Fsck.hs
parenta4ae347a5ca8657f5bcd2561012b700fb95d79f6 (diff)
fsck: When a key is not previously known in the location log, record something so that reinject --known will work.
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r--Command/Fsck.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs
index fb8290281..28ce7752d 100644
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -258,7 +258,14 @@ verifyLocationLog' key desc present u updatestatus = do
++ "\n** was expected to be present, " ++
"but its content is missing."
return False
- _ -> return True
+ (False, False) -> do
+ -- When the location log for the key is not present,
+ -- create it, so that the key will be known.
+ when (null uuids) $
+ whenM (not <$> isKnownKey key) $
+ updatestatus InfoMissing
+ return True
+ (True, True) -> return True
where
fix s = do
showNote "fixing location log"