implement Unavilable for gcrypt
Sponsored-by: Brett Eisenberg on Patreon
This commit is contained in:
parent
977403d338
commit
7aac60769a
4 changed files with 23 additions and 26 deletions
|
@ -231,26 +231,6 @@ unavailable r = gen r'
|
|||
Nothing -> r { Git.location = Git.Unknown }
|
||||
_ -> r -- already unavailable
|
||||
|
||||
{- Checks relatively inexpensively if a repository is available for use. -}
|
||||
repoAvail :: Git.Repo -> Annex Availability
|
||||
repoAvail r
|
||||
| Git.repoIsHttp r = return GloballyAvailable
|
||||
| Git.GCrypt.isEncrypted r = do
|
||||
g <- gitRepo
|
||||
liftIO $ do
|
||||
er <- Git.GCrypt.encryptedRemote g r
|
||||
if Git.repoIsLocal er || Git.repoIsLocalUnknown er
|
||||
then checklocal er
|
||||
else return GloballyAvailable
|
||||
| Git.repoIsUrl r = return GloballyAvailable
|
||||
| Git.repoIsLocalUnknown r = return Unavailable
|
||||
| otherwise = checklocal r
|
||||
where
|
||||
checklocal r' = ifM (liftIO $ isJust <$> catchMaybeIO (Git.Config.read r'))
|
||||
( return LocallyAvailable
|
||||
, return Unavailable
|
||||
)
|
||||
|
||||
{- Tries to read the config for a specified remote, updates state, and
|
||||
- returns the updated repo. -}
|
||||
tryGitConfigRead :: Bool -> Git.Repo -> Bool -> Annex Git.Repo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue