Ignore "bad usage" error code in case `git tag` doesn't know of the `--contains` option.

release-1.1
Thomas Keller 2011-03-17 23:12:27 +01:00
parent 5f008a14f5
commit 366d278182
1 changed files with 8 additions and 4 deletions

View File

@ -248,10 +248,14 @@ class IDF_Scm_Git extends IDF_Scm
Pluf::f('git_path', 'git'), Pluf::f('git_path', 'git'),
escapeshellarg($commit)); escapeshellarg($commit));
self::exec('IDF_Scm_Git::inTags', $cmd, $out, $return); self::exec('IDF_Scm_Git::inTags', $cmd, $out, $return);
if (0 != $return) { // `git tag` gained the `--contains` option in 1.6.2, earlier
$this->cache['tags'] = array(); // versions report a bad usage error (129) which we ignore here
if (129 == $return) {
$this->cache['inTags'][$commit] = array();
return array(); return array();
// Ugly emergency fix, needs to be cleaned. }
// any other error should of course get noted
if (0 != $return) {
throw new IDF_Scm_Exception(sprintf($this->error_tpl, throw new IDF_Scm_Exception(sprintf($this->error_tpl,
$cmd, $return, $cmd, $return,
implode("\n", $out))); implode("\n", $out)));
@ -654,7 +658,7 @@ class IDF_Scm_Git extends IDF_Scm
/** /**
* @see IDF_Scm::getDiffPathStripLevel() * @see IDF_Scm::getDiffPathStripLevel()
*/ */
public function getDiffPathStripLevel() public function getDiffPathStripLevel()
{ {
return 1; return 1;