avoid failing if a local repo is not currently available
The added check if a repo is bare means its config needs to be read, but in this case it cannot be. That means that a repo currently not available is assumed to be non-bare.
This commit is contained in:
parent
eeadc2e3e0
commit
e49e6a403b
1 changed files with 5 additions and 2 deletions
|
@ -163,12 +163,15 @@ repoIsSsh Repo { location = Url url }
|
||||||
| otherwise = False
|
| otherwise = False
|
||||||
repoIsSsh _ = False
|
repoIsSsh _ = False
|
||||||
|
|
||||||
|
configAvail ::Repo -> Bool
|
||||||
|
configAvail Repo { config = c } = c /= Map.empty
|
||||||
|
|
||||||
repoIsLocalBare :: Repo -> Bool
|
repoIsLocalBare :: Repo -> Bool
|
||||||
repoIsLocalBare r@(Repo { location = Dir _ }) = configBare r
|
repoIsLocalBare r@(Repo { location = Dir _ }) = configAvail r && configBare r
|
||||||
repoIsLocalBare _ = False
|
repoIsLocalBare _ = False
|
||||||
|
|
||||||
repoIsLocalFull :: Repo -> Bool
|
repoIsLocalFull :: Repo -> Bool
|
||||||
repoIsLocalFull r@(Repo { location = Dir _ }) = not $ configBare r
|
repoIsLocalFull r@(Repo { location = Dir _ }) = configAvail r && not (configBare r)
|
||||||
repoIsLocalFull _ = False
|
repoIsLocalFull _ = False
|
||||||
|
|
||||||
assertLocal :: Repo -> a -> a
|
assertLocal :: Repo -> a -> a
|
||||||
|
|
Loading…
Reference in a new issue