remove uuid from url when calling git credential
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.
This commit is contained in:
parent
b89c784a9b
commit
75771772ec
2 changed files with 6 additions and 2 deletions
|
@ -24,7 +24,6 @@ import P2P.Http.Url
|
||||||
import Annex.Common
|
import Annex.Common
|
||||||
import P2P.Protocol hiding (Offset, Bypass, auth)
|
import P2P.Protocol hiding (Offset, Bypass, auth)
|
||||||
import Annex.Concurrent
|
import Annex.Concurrent
|
||||||
import Messages
|
|
||||||
import Utility.Url (BasicAuth(..))
|
import Utility.Url (BasicAuth(..))
|
||||||
import qualified Git.Credential as Git
|
import qualified Git.Credential as Git
|
||||||
|
|
||||||
|
@ -100,7 +99,9 @@ p2pHttpClient rmt fallback clientaction =
|
||||||
case p2pHttpUrlString <$> remoteAnnexP2PHttpUrl (gitconfig rmt) of
|
case p2pHttpUrlString <$> remoteAnnexP2PHttpUrl (gitconfig rmt) of
|
||||||
Nothing -> error "internal"
|
Nothing -> error "internal"
|
||||||
Just url -> do
|
Just url -> do
|
||||||
cred <- prompt (inRepo $ Git.getUrlCredential url)
|
cred <- prompt $
|
||||||
|
inRepo $ Git.getUrlCredential $
|
||||||
|
p2pHttpUrlWithoutUUID url
|
||||||
let mauth = do
|
let mauth = do
|
||||||
ba <- Git.credentialBasicAuth cred
|
ba <- Git.credentialBasicAuth cred
|
||||||
return $ Auth
|
return $ Auth
|
||||||
|
|
|
@ -88,3 +88,6 @@ parseP2PHttpUrl us
|
||||||
, baseUrlPort = port
|
, baseUrlPort = port
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
p2pHttpUrlWithoutUUID :: String -> String
|
||||||
|
p2pHttpUrlWithoutUUID = reverse . dropWhile (/= '/') . reverse
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue