Merge branch 'mc/netrc-service-names'

"netrc" credential helper has been improved to understand textual
service names (like smtp) in addition to the numeric port numbers
(like 25).

* mc/netrc-service-names:
  contrib: better support symbolic port names in git-credential-netrc
  contrib: warn for invalid netrc file ports in git-credential-netrc
  contrib: use a more portable shebang for git-credential-netrc
This commit is contained in:
Junio C Hamano
2025-07-14 11:19:25 -07:00
5 changed files with 46 additions and 7 deletions

View File

@@ -2112,6 +2112,17 @@ if ($validate) {
}
}
# Validate the SMTP server port, if provided.
if (defined $smtp_server_port) {
my $port = Git::port_num($smtp_server_port);
if ($port) {
$smtp_server_port = $port;
} else {
die sprintf(__("error: invalid SMTP port '%s'\n"),
$smtp_server_port);
}
}
# Run the loop once again to avoid gaps in the counter due to FIFO
# arguments provided by the user.
my $num = 1;