diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-11-10 14:44:58 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-11-10 14:44:58 -0400 |
commit | 511fb47fd7728dbdc01c353f6cba2dfe8433dd7b (patch) | |
tree | 58d29b1bf43a98a5ce767d32c79f2b9440647805 /Command | |
parent | dacadaae32183b2501bda42d38ba4cae8eeff12b (diff) |
display a message in the unlikely scenario of fsking a dead repository
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Fsck.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs index 5561f9160..5a11ce192 100644 --- a/Command/Fsck.hs +++ b/Command/Fsck.hs @@ -90,6 +90,7 @@ seek :: FsckOptions -> CommandSeek seek o = allowConcurrentOutput $ do from <- maybe (pure Nothing) (Just <$$> getParsed) (fsckFromOption o) u <- maybe getUUID (pure . Remote.uuid) from + checkDeadRepo u i <- prepIncremental u (incrementalOpt o) withKeyOptions (keyOptions o) False (\k -> startKey i k =<< getNumCopies) @@ -98,6 +99,11 @@ seek o = allowConcurrentOutput $ do cleanupIncremental i void $ tryIO $ recordActivity Fsck u +checkDeadRepo :: UUID -> Annex () +checkDeadRepo u = + whenM ((==) DeadTrusted <$> lookupTrust u) $ + earlyWarning "Warning: Fscking a repository that is currently marked as dead." + start :: Maybe Remote -> Incremental -> FilePath -> Key -> CommandStart start from inc file key = do v <- Backend.getBackend file key |