display a message in the unlikely scenario of fsking a dead repository

This commit is contained in:
Joey Hess 2015-11-10 14:44:58 -04:00
parent 468e52fbe3
commit 4b02af57b6
Failed to extract signature
5 changed files with 30 additions and 1 deletions

View file

@ -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