summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2022-09-12 21:58:16 +0100
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2022-09-12 22:17:22 +0100
commit1b6686b25071fafd79b9bae431ef8190f3e29d0f (patch)
treee12de9bec0d467d000bef25b949581aef0fa0ff0
parent289e5f30b0311cb951f9d52c0e4ff6d1b9892f39 (diff)
downloadperl-1b6686b25071fafd79b9bae431ef8190f3e29d0f.tar.gz
Fix t/porting/authors.t breakgage for people with non-ASCII names
The lack of decoding of git config values in Porting/updateAUTHORS.pm would make it erroneously claim that anyone with a non-ASCII character in their name was an unknown author. The decoding and encoding in updateAUTHORS.pl is not strictly necessary, since that's just passing things through to the terminal, but let's be consistent.
-rwxr-xr-xPorting/updateAUTHORS.pl6
-rw-r--r--Porting/updateAUTHORS.pm2
2 files changed, 4 insertions, 4 deletions
diff --git a/Porting/updateAUTHORS.pl b/Porting/updateAUTHORS.pl
index 00f551acb3..490ba6d2ec 100755
--- a/Porting/updateAUTHORS.pl
+++ b/Porting/updateAUTHORS.pl
@@ -5,7 +5,7 @@ use warnings;
use Getopt::Long qw(GetOptions);
use Pod::Usage qw(pod2usage);
use Data::Dumper;
-use Encode qw(encode_utf8 decode_utf8 decode);
+use Encode qw(encode_utf8 decode_utf8);
use lib "./";
use Porting::updateAUTHORS;
use Test::More;
@@ -292,7 +292,7 @@ sub error_advice_for_uncommitted_changes {
}
my $quote= $^O =~ /Win/ ? '"' : "'";
- my @config=
+ my @config= map decode_utf8($_),
`git config --get-regexp $quote^(user|author|committer).(name|email)$quote`;
if (@config) {
@@ -337,7 +337,7 @@ EOF_EXTRA
EOF_PROPS
}
- return <<"EOF_MESAGE";
+ return encode_utf8 <<"EOF_MESAGE";
There are uncommitted changes in the working directory
$uncommitted_files
diff --git a/Porting/updateAUTHORS.pm b/Porting/updateAUTHORS.pm
index 8269a24514..266c547a0c 100644
--- a/Porting/updateAUTHORS.pm
+++ b/Porting/updateAUTHORS.pm
@@ -111,7 +111,7 @@ sub _register_author {
sub git_conf_get {
my ($self, $setting)= @_;
chomp(my $value= `git config --get $setting`);
- return $value;
+ return decode_utf8 $value;
}
sub current_git_user_name {