testremote passes on p2phttp remote
authorJoey Hess <joeyh@joeyh.name>
Wed, 24 Jul 2024 18:36:37 +0000 (14:36 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 24 Jul 2024 18:42:24 +0000 (14:42 -0400)
P2P/Http/Url.hs
Remote/Git.hs

index 92439623fbda4b9404956009e3063063cbef303d..6d308741c928c8d2862cd76276dfd2cd720c563b 100644 (file)
@@ -91,3 +91,9 @@ parseP2PHttpUrl us
 
 p2pHttpUrlWithoutUUID :: String -> String
 p2pHttpUrlWithoutUUID = reverse . dropWhile (/= '/') . reverse
+
+unavailableP2PHttpUrl :: P2PHttpUrl -> P2PHttpUrl
+unavailableP2PHttpUrl p = p
+#ifdef WITH_SERVANT
+       { p2pHttpBaseUrl = (p2pHttpBaseUrl p) { baseUrlHost = "!dne!" } }
+#endif
index ceccacc66e438b9a81db27e6d16bcfb76913c1bd..93a0c89c7aaeae9d6b0cbb6587203305de3b45e3 100644 (file)
@@ -264,7 +264,7 @@ defaultRepoCost r
        | otherwise = expensiveRemoteCost
 
 unavailable :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> RemoteStateHandle -> Annex (Maybe Remote)
-unavailable r = gen r'
+unavailable r u c gc = gen r' u c gc'
   where
        r' = case Git.location r of
                Git.Local { Git.gitdir = d } ->
@@ -275,6 +275,10 @@ unavailable r = gen r'
                                in r { Git.location = Git.Url (url { uriAuthority = Just auth' })}
                        Nothing -> r { Git.location = Git.Unknown }
                _ -> r -- already unavailable
+       gc' = gc
+               { remoteAnnexP2PHttpUrl =
+                       unavailableP2PHttpUrl <$> remoteAnnexP2PHttpUrl gc
+               }
 
 {- Tries to read the config for a specified remote, updates state, and
  - returns the updated repo. -}