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
|
||||
repoIsSsh _ = False
|
||||
|
||||
configAvail ::Repo -> Bool
|
||||
configAvail Repo { config = c } = c /= Map.empty
|
||||
|
||||
repoIsLocalBare :: Repo -> Bool
|
||||
repoIsLocalBare r@(Repo { location = Dir _ }) = configBare r
|
||||
repoIsLocalBare r@(Repo { location = Dir _ }) = configAvail r && configBare r
|
||||
repoIsLocalBare _ = False
|
||||
|
||||
repoIsLocalFull :: Repo -> Bool
|
||||
repoIsLocalFull r@(Repo { location = Dir _ }) = not $ configBare r
|
||||
repoIsLocalFull r@(Repo { location = Dir _ }) = configAvail r && not (configBare r)
|
||||
repoIsLocalFull _ = False
|
||||
|
||||
assertLocal :: Repo -> a -> a
|
||||
|
|
Loading…
Reference in a new issue