From 3a2c46e6f7bf650e69cf7c7b9e3d62843e6deab9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 13 Mar 2023 19:38:25 +0000 Subject: use v5.12 for various network client-side packages None of these are affected by the Perl unicode_strings feature, so they can `use v5.12' safely --- lib/PublicInbox/GitCredential.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/GitCredential.pm') diff --git a/lib/PublicInbox/GitCredential.pm b/lib/PublicInbox/GitCredential.pm index b18bba1e..10114a10 100644 --- a/lib/PublicInbox/GitCredential.pm +++ b/lib/PublicInbox/GitCredential.pm @@ -1,7 +1,9 @@ -# Copyright (C) 2020-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ + +# git-credential wrapper with built-in .netrc fallback package PublicInbox::GitCredential; -use strict; +use v5.12; use PublicInbox::Spawn qw(popen_rd); sub run ($$;$) { @@ -19,7 +21,7 @@ sub run ($$;$) { my $out = ''; for my $k (qw(url protocol host username password)) { - defined(my $v = $self->{$k}) or next; + my $v = $self->{$k} // next; die "`$k' contains `\\n' or `\\0'\n" if $v =~ /[\n\0]/; $out .= "$k=$v\n"; } -- cgit v1.2.3-24-ge0c7