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

This commit is contained in:
Thomas Keller 2011-03-17 23:12:27 +01:00
parent 5f008a14f5
commit 366d278182

View File

@ -248,10 +248,14 @@ class IDF_Scm_Git extends IDF_Scm
Pluf::f('git_path', 'git'),
escapeshellarg($commit));
self::exec('IDF_Scm_Git::inTags', $cmd, $out, $return);
if (0 != $return) {
$this->cache['tags'] = array();
// `git tag` gained the `--contains` option in 1.6.2, earlier
// versions report a bad usage error (129) which we ignore here
if (129 == $return) {
$this->cache['inTags'][$commit] = 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,
$cmd, $return,
implode("\n", $out)));