mirror of
https://github.com/git/git.git
synced 2026-03-14 10:53:25 +01:00
http: use hostname in credential description
Until now, a request for an http password looked like: Username: Password: Now it will look like: Username for 'example.com': Password for 'example.com': Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
00b1daa2c1
commit
dad8534f86
7
http.c
7
http.c
@@ -310,7 +310,6 @@ static CURL *get_curl_handle(void)
|
||||
static void http_auth_init(const char *url)
|
||||
{
|
||||
const char *at, *colon, *cp, *slash, *host, *proto_end;
|
||||
char *decoded;
|
||||
struct strbuf unique = STRBUF_INIT;
|
||||
|
||||
proto_end = strstr(url, "://");
|
||||
@@ -342,11 +341,11 @@ static void http_auth_init(const char *url)
|
||||
host = at + 1;
|
||||
}
|
||||
|
||||
http_auth.description = url_decode_mem(host, slash - host);
|
||||
|
||||
strbuf_add(&unique, url, proto_end - url);
|
||||
strbuf_addch(&unique, ':');
|
||||
decoded = url_decode_mem(host, slash - host);
|
||||
strbuf_addstr(&unique, decoded);
|
||||
free(decoded);
|
||||
strbuf_addstr(&unique, http_auth.description);
|
||||
http_auth.unique = strbuf_detach(&unique, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ test_expect_success 'setup askpass helpers' '
|
||||
GIT_ASKPASS="$PWD/askpass" &&
|
||||
export GIT_ASKPASS &&
|
||||
>askpass-expect-none &&
|
||||
echo "askpass: Password: " >askpass-expect-pass &&
|
||||
{ echo "askpass: Username: " &&
|
||||
echo "askpass: Password for '\''$HTTPD_DEST'\'': " >askpass-expect-pass &&
|
||||
{ echo "askpass: Username for '\''$HTTPD_DEST'\'': " &&
|
||||
cat askpass-expect-pass
|
||||
} >askpass-expect-both
|
||||
'
|
||||
|
||||
Reference in New Issue
Block a user