Commit:    c1cce169b8836c0b4b4c1d43fde38840e8dfb7df
Author:    David Soria Parra <d...@php.net>         Thu, 22 Mar 2012 07:55:38 
+0100
Parents:   b9eaafaca29082302885facb1006d8241730d9a4
Branches:  dsp/playground

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

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:
c1cce169b8836c0b4b4c1d43fde38840e8dfb7df
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index e9d9d74..f427a76 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -453,7 +453,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);
     }
 
     private function getBranchesForRevision($revision) {


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

Reply via email to