com karma: Check the user, too: hooks/pre-receive
| From: | Johannes Schlüter | Date: | Sat, 25 Jan 2014 00:43:04 +0000 |
| Subject: | com karma: Check the user, too: hooks/pre-receive | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75784@lists.php.net to get a copy of this message | ||
Commit: 1eda3318816a9dee2382877fc9cf1388f2fc1314
Author: Johannes Schlüter <johannes@schlueters.de> Sat, 25 Jan 2014 01:43:04 +0100
Parents: 6cebcef390f2019f4dbce37f6ecc386f680ce646
Branches: master
Link: http://git.php.net/?p=karma.git;a=commitdiff;h=1eda3318816a9dee2382877fc9cf1388f2fc1314
Log:
Check the user, too
Changed paths:
M hooks/pre-receive
Diff:
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 8382ca4..13ae9d8 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -134,8 +134,8 @@ if (empty($req_paths)) {
if (isset($closedBranches[$repo_name])) {
$closed = array_filter(array_keys($closedBranches[$repo_name]),
- function ($branch) use ($pi) {
- return in_array($branch, $pi->getBranches());
+ function ($branch) use ($pi, $user, $closedBranches, $repo_name) {
+ return in_array($branch, $pi->getBranches()) && !in_array($user,
$closedBranches[$repo_name][$branch]);
});
if (count($closed)) {