Skip to content

Commit a45f924

Browse files
AdityaGarg8gitster
authored andcommitted
imap-send: display port alongwith host when git credential is invoked
When requesting for passsword, git credential helper used to display only the host name. For example: Password for 'imaps://gargaditya08%[email protected]': Now, it will display the port along with the host name: Password for 'imaps://gargaditya08%[email protected]:993': This has been done to make credential helpers more specific for ports. Also, this behaviour will also mimic git send-email, which displays the port along with the host name when requesting for a password. FWIW, if no port is specified by the user, the default port, 993 for IMAPS and 143 for IMAP is used by the code. So, the case of no port defined for the helper is not possible, and therefore is not added. Signed-off-by: Aditya Garg <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 27ab125 commit a45f924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imap-send.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ static void server_fill_credential(struct imap_server_conf *srvc, struct credent
11041104
return;
11051105

11061106
cred->protocol = xstrdup(srvc->use_ssl ? "imaps" : "imap");
1107-
cred->host = xstrdup(srvc->host);
1107+
cred->host = xstrfmt("%s:%d", srvc->host, srvc->port);
11081108

11091109
cred->username = xstrdup_or_null(srvc->user);
11101110
cred->password = xstrdup_or_null(srvc->pass);

0 commit comments

Comments
 (0)