Skip to content

Commit c974275

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 3654527 commit c974275

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
@@ -1083,7 +1083,7 @@ static void server_fill_credential(struct imap_server_conf *srvc, struct credent
10831083
return;
10841084

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

10881088
cred->username = xstrdup_or_null(srvc->user);
10891089
cred->password = xstrdup_or_null(srvc->pass);

0 commit comments

Comments
 (0)