mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
contrib: warn for invalid netrc file ports in git-credential-netrc
Invalid ports were previously silently dropped; now a warning message is produced. Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
3570fba943
commit
53ca38298d
@@ -267,9 +267,14 @@ sub load_netrc {
|
||||
if (!defined $nentry->{machine}) {
|
||||
next;
|
||||
}
|
||||
if (defined $nentry->{port} && $nentry->{port} =~ m/^\d+$/) {
|
||||
$num_port = $nentry->{port};
|
||||
delete $nentry->{port};
|
||||
if (defined $nentry->{port}) {
|
||||
if ($nentry->{port} =~ m/^\d+$/) {
|
||||
$num_port = $nentry->{port};
|
||||
delete $nentry->{port};
|
||||
} else {
|
||||
printf(STDERR "ignoring invalid port `%s' " .
|
||||
"from netrc file\n", $nentry->{port});
|
||||
}
|
||||
}
|
||||
|
||||
# create the new entry for the credential helper protocol
|
||||
|
||||
Reference in New Issue
Block a user