/** * Returns the common ancestor revision for two given revisions * * Returns false if no sha1 was returned. Throws an exception if calling * git fails. * * @return boolean */ protected function mergeBase($oldrev, $newrev) { $baserev = \Git::gitExec('merge-base %s %s', escapeshellarg($oldrev), escapeshellarg($newrev)); $baserev = trim($baserev); if (40 != strlen($baserev)) { return false; } return $baserev; }
/** * Returns true if git option karma.ignored is set, otherwise false. * * @return boolean */ public function isKarmaIgnored() { return 'true' === \Git::gitExec('config karma.ignored'); }
/** * Return array with branches names in repository * * @return array */ protected function getAllBranches() { $branches = explode("\n", trim(\Git::gitExec('for-each-ref --format="%%(refname)" "refs/heads/*"'))); if ($branches[0] == '') { $branches = []; } return $branches; }