Added full debug of Scm call only when debug flag set.

This is because git will return an error code when testing if a commit
exists and in fact does not exist. So it means that we get an exception
on all the string "commit foo" when foo is not a commit in the issue
text.
dev
Loic d'Anterroches 2008-11-27 10:03:30 +01:00
parent eb60e99d5c
commit 566c90cf6a
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ class IDF_Scm
$cache = Pluf_Cache::factory(); $cache = Pluf_Cache::factory();
if (null === ($res=$cache->get($key))) { if (null === ($res=$cache->get($key))) {
$ll = exec($command, $output, $return); $ll = exec($command, $output, $return);
if ($return != 0) { if ($return != 0 and Pluf::f('debug', false)) {
throw new IDF_Scm_Exception(sprintf('Error when running command: "%s", return code: %d', $command, $return)); throw new IDF_Scm_Exception(sprintf('Error when running command: "%s", return code: %d', $command, $return));
} }
$cache->set($key, array($ll, $return, $output)); $cache->set($key, array($ll, $return, $output));