avoid getting config parser when there is no config to parse
The benefit here is that external special remotes will need a LISTCONFIGS request and response to generate their config parser, and this avoids it being done for all the ones that don't have any configs. Note that, a config parser could in theory fail to parse if there are no configs (none currently do), but a parse failure is already thrown away when generating the remote list because it's too late. Such problems have to be caught at initremote/enableremote time, not here.
This commit is contained in:
parent
6eea31acb8
commit
e78bf29725
1 changed files with 3 additions and 1 deletions
|
@ -110,7 +110,9 @@ remoteGen m t g = do
|
|||
let cu = fromMaybe u $ remoteAnnexConfigUUID gc
|
||||
let rs = RemoteStateHandle cu
|
||||
let c = fromMaybe M.empty $ M.lookup cu m
|
||||
pc <- either mempty id . parseRemoteConfig c <$> configParser t
|
||||
pc <- if null c
|
||||
then pure mempty
|
||||
else either mempty id . parseRemoteConfig c <$> configParser t
|
||||
generate t g u pc gc rs >>= \case
|
||||
Nothing -> return Nothing
|
||||
Just r -> Just <$> adjustExportImport (adjustReadOnly (addHooks r)) rs
|
||||
|
|
Loading…
Add table
Reference in a new issue