sync: support gcrypt

This commit is contained in:
Joey Hess 2013-09-09 09:58:17 -04:00
parent 51ee077d58
commit b64f5baf2d
7 changed files with 23 additions and 14 deletions

View file

@ -125,6 +125,14 @@ gen r u c gc
repoAvail :: Git.Repo -> Annex Bool
repoAvail r
| Git.repoIsHttp r = return True
| Git.GCrypt.isEncrypted r = do
g <- gitRepo
liftIO $ do
er <- Git.GCrypt.encryptedRepo g r
if Git.repoIsLocal er || Git.repoIsLocalUnknown er
then catchBoolIO $
void (Git.Config.read er) >> return True
else return True
| Git.repoIsUrl r = return True
| Git.repoIsLocalUnknown r = return False
| otherwise = liftIO $ catchBoolIO $ onLocal r $ return True

View file

@ -100,6 +100,7 @@ updateRemote remote = do
Remote.Git.configRead r
| otherwise = return r
{- Checks if a remote is a special remote -}
specialRemote :: Remote -> Bool
specialRemote r = remotetype r /= Remote.Git.remote
{- Checks if a remote is syncable using git. -}
syncableRemote :: Remote -> Bool
syncableRemote r = remotetype r `elem`
[ Remote.Git.remote, Remote.GCrypt.remote ]