Commit:    4eb17646d5c809be94d25e04910db474e4ff1848
Author:    David Soria Parra <d...@php.net>         Thu, 22 Mar 2012 07:55:38 
+0100
Committer: Alexander Moskaliov <ir...@php.net>      Thu, 22 Mar 2012 12:27:17 
+0400
Parents:   42b7508bdc7867645728fb9e765aecadae333609
Branches:  master

Link:       
http://git.php.net/?p=karma.git;a=commitdiff;h=4eb17646d5c809be94d25e04910db474e4ff1848

Log:
Check for empty outputs, not for return values

gitExec doesnt return the return value but the output. Therefore
check if the output in isRevInBranches is empty. This indicates
that it is not.

Changed paths:
  M  lib/Git/PostReceiveHook.php


Diff:
4eb17646d5c809be94d25e04910db474e4ff1848
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index b7efb42..f1594f6 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -589,7 +589,8 @@ class PostReceiveHook extends ReceiveHook
      * @return bool
      */
     private function isRevExistsInBranches($revision, array $branches) {
-        return !(bool) \Git::gitExec('rev-list --max-count=1 %s --not %s', 
escapeshellarg($revision), implode(' ', 
$this->escapeArrayShellArgs($branches)));
+        $output = \Git::gitExec('rev-list --max-count=1 %s --not %s', 
escapeshellarg($revision), implode(' ', 
$this->escapeArrayShellArgs($branches)));
+        return !empty($output);
     }
 
 }


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to