The user doesn't want to see a uuid in the prompt.
Also, when a http server is proxying, multiple remotes will have the
same base url, and the same password will work for them all.
import Annex.Common
import P2P.Protocol hiding (Offset, Bypass, auth)
import Annex.Concurrent
-import Messages
import Utility.Url (BasicAuth(..))
import qualified Git.Credential as Git
case p2pHttpUrlString <$> remoteAnnexP2PHttpUrl (gitconfig rmt) of
Nothing -> error "internal"
Just url -> do
- cred <- prompt (inRepo $ Git.getUrlCredential url)
+ cred <- prompt $
+ inRepo $ Git.getUrlCredential $
+ p2pHttpUrlWithoutUUID url
let mauth = do
ba <- Git.credentialBasicAuth cred
return $ Auth
, baseUrlPort = port
}
#endif
+
+p2pHttpUrlWithoutUUID :: String -> String
+p2pHttpUrlWithoutUUID = reverse . dropWhile (/= '/') . reverse