avoid verification when hard linking to objects in shared repository

Such a repository is implicitly trusted, so there's no point.
This commit is contained in:
Joey Hess 2015-10-02 12:36:03 -04:00
parent 52891fc17c
commit c6632ee5c8
2 changed files with 32 additions and 13 deletions

View file

@ -268,10 +268,11 @@ verifyKeyContent v k f = verifysize <&&> verifycontent
, return True
)
data Verify = AlwaysVerify | RemoteVerify Remote | DefaultVerify
data Verify = AlwaysVerify | NoVerify | RemoteVerify Remote | DefaultVerify
shouldVerify :: Verify -> Annex Bool
shouldVerify AlwaysVerify = return True
shouldVerify NoVerify = return False
shouldVerify DefaultVerify = annexVerify <$> Annex.getGitConfig
shouldVerify (RemoteVerify r) = shouldVerify DefaultVerify
<&&> pure (remoteAnnexVerify (Types.Remote.gitconfig r))