skip local remotes that are not available (ie, not mounted)
With --fast, unavailable local remotes are filtered out of the fast set. This way, if there are local remotes, --fast always acts only on them, and if none are mounted, acts on nothing. This consistency is better than --fast acting on different remotes depending on what's mounted.
This commit is contained in:
parent
25e4b116c7
commit
f0957426c5
3 changed files with 13 additions and 4 deletions
|
@ -5,7 +5,7 @@
|
|||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
module Remote.Git (remote) where
|
||||
module Remote.Git (remote, repoAvail) where
|
||||
|
||||
import Control.Exception.Extensible
|
||||
import qualified Data.Map as M
|
||||
|
@ -164,6 +164,13 @@ inAnnex r key
|
|||
dispatch (Right Nothing) = unknown
|
||||
unknown = Left $ "unable to check " ++ Git.repoDescribe r
|
||||
|
||||
{- Checks inexpensively if a repository is available for use. -}
|
||||
repoAvail :: Git.Repo -> Annex Bool
|
||||
repoAvail r
|
||||
| Git.repoIsHttp r = return True
|
||||
| Git.repoIsUrl r = return True
|
||||
| otherwise = liftIO $ catchBoolIO $ onLocal r $ return True
|
||||
|
||||
{- Runs an action on a local repository inexpensively, by making an annex
|
||||
- monad using that repository. -}
|
||||
onLocal :: Git.Repo -> Annex a -> IO a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue