diff options
author | Eric Wong <e@80x24.org> | 2023-03-13 19:38:25 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-03-14 20:51:00 +0000 |
commit | 3a2c46e6f7bf650e69cf7c7b9e3d62843e6deab9 (patch) | |
tree | eb5235509b67472ec6c1520d9cd4967433684fc0 /lib/PublicInbox/GitCredential.pm | |
parent | b192069672eb5e9de3fdd07064a9c9231390d584 (diff) | |
download | public-inbox-3a2c46e6f7bf650e69cf7c7b9e3d62843e6deab9.tar.gz |
None of these are affected by the Perl unicode_strings feature, so they can `use v5.12' safely
Diffstat (limited to 'lib/PublicInbox/GitCredential.pm')
-rw-r--r-- | lib/PublicInbox/GitCredential.pm | 8 |
1 files changed, 5 insertions, 3 deletions
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 <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> + +# 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"; } |