From f916ce4b689bd26096b28d9c8c159552e318bbbd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Jun 2024 17:02:23 -0400 Subject: [PATCH] allow proxying to remotes that are nodes of clusters fixes reversion in ca08f3fcc2ca6d203fa1a323986f7f86bd342e3d --- CmdLine/GitAnnexShell.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CmdLine/GitAnnexShell.hs b/CmdLine/GitAnnexShell.hs index f70eb0be42..cc4fb406bc 100644 --- a/CmdLine/GitAnnexShell.hs +++ b/CmdLine/GitAnnexShell.hs @@ -204,8 +204,12 @@ checkProxy remoteuuid ouruuid = M.lookup ouruuid <$> getProxies >>= \case -- be used as a proxy. proxyfor ps = do rs <- concat . byCost <$> remoteList + myclusters <- annexClusters <$> Annex.getGitConfig let sameuuid r = uuid r == remoteuuid - let proxyconfigured = remoteAnnexProxy . R.gitconfig + -- Only proxy for a remote when the git configuration + -- allows it. + let proxyconfigured r = remoteAnnexProxy (R.gitconfig r) + || (any (`M.member` myclusters) $ fromMaybe [] $ remoteAnnexClusterNode $ R.gitconfig r) let samename r p = name r == proxyRemoteName p case headMaybe (filter (\r -> sameuuid r && proxyconfigured r && any (samename r) ps) rs) of Nothing -> notconfigured -- 2.39.5