summaryrefslogtreecommitdiffstats
path: root/git-hooks/gerrit-bot
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2019-07-31 10:23:08 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2019-08-07 08:44:15 +0000
commit157ec79c64c8aba721536a4f06f656a2af15d4d3 (patch)
tree703ae75405fb0cbee3e7872b51b4599b43a1dc3e /git-hooks/gerrit-bot
parent9d73411360b154e8d415b08dc0c295592a8adc00 (diff)
gerrit-bot: Fix syntax problem due to too much arcane punctuation
We now check for the existence of the comment section in a slightly more readable way and then proceed based on that. Done-with: Orgad Shaneh <orgad.shaneh@audiocodes.com> Fixes: QTQAINFRA-2988 Change-Id: I90ddef66b97fea42bd9723a234235820bb21875a Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'git-hooks/gerrit-bot')
-rwxr-xr-xgit-hooks/gerrit-bot3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-hooks/gerrit-bot b/git-hooks/gerrit-bot
index 4424227..287ad98 100755
--- a/git-hooks/gerrit-bot
+++ b/git-hooks/gerrit-bot
@@ -222,7 +222,8 @@ sub process_commit($$$$$)
}
}
$$verdict{tag} = 'autogenerated:sanity';
- if ($$verdict{labels}{'Sanity-Review'} == 1 && int(@{$$verdict{comments} || []}) == 0) {
+ my $hasComments = defined $$verdict{comments} && %{$$verdict{comments}};
+ if ($$verdict{labels}{'Sanity-Review'} == 1 && !$hasComments) {
# Don't spam everyone about a boring +1 sanity review with no comments.
$$verdict{notify} = "NONE";
}