diff options
author | 2024-01-25 22:06:01 -0800 | |
---|---|---|
committer | 2024-01-25 22:06:01 -0800 | |
commit | 6af4f6b668fa3d2d99390331d3a3768eba27834f (patch) | |
tree | 7702f0e21fc07674695eeddfc2f24d4777d58a51 | |
parent | fix: local/post-receive.gentoo-commits should support committer_realname_asci... (diff) | |
download | githooks-6af4f6b668fa3d2d99390331d3a3768eba27834f.tar.gz githooks-6af4f6b668fa3d2d99390331d3a3768eba27834f.tar.bz2 githooks-6af4f6b668fa3d2d99390331d3a3768eba27834f.zip |
fix: local/post-receive.gentoo-commits should log why the legacy committer detection firedgithooks-20240126T060601Z
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | local/post-receive.gentoo-commits | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/local/post-receive.gentoo-commits b/local/post-receive.gentoo-commits index 040dda4..954b416 100755 --- a/local/post-receive.gentoo-commits +++ b/local/post-receive.gentoo-commits @@ -419,12 +419,17 @@ sub get_data($) { } # Committer already got its data from the key metadata # but in case there went something wrong.. - if ((!$data{"committer_email"} || !$data{"committer_realname"} || !$data{"committer"}) && $field eq "committer") { - warn("Warning: falling back to legacy committer detection as no or not enough metadata was provided"); - $data{"committer_email"} = pop(@fields); - $data{"committer_email"} =~ s/[<>]//g; - $data{"committer_realname"} = join(" ", @fields); - $data{"committer"} = $data{"committer_realname"}." <".$data{"committer_email"}.">"; + if($field eq "committer") { + if (!$data{"committer_email"} || !$data{"committer_realname"} || !$data{"committer"}) { + { + no warnings 'uninitialized'; + warn("Warning: falling back to legacy committer detection as no or not enough metadata was provided committer_email=$committer_email committer_realname=$committer_realname committer=$committer"); + } + $data{"committer_email"} = pop(@fields); + $data{"committer_email"} =~ s/[<>]//g; + $data{"committer_realname"} = join(" ", @fields); + $data{"committer"} = $data{"committer_realname"}." <".$data{"committer_email"}.">"; + } } } else { |