[PHP-CVS] com karma: Check for empty outputs, not for return values: lib/Git/PostReceiveHook.php
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
[PHP-CVS] com karma: Check for empty outputs, not for return values: lib/Git/PostReceiveHook.php
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