Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Don't access class properties when trying to get branch data. Load it…
Browse files Browse the repository at this point in the history
… directly from file system
  • Loading branch information
poepperl authored and poepperl committed Nov 6, 2012
1 parent 37e352f commit 3128a53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions DataCollector/GitDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function collect(Request $request, Response $response, \Exception $except
*/
public function getBranch()
{
return $this->data['branch'];
return $this->getCurrentBranch();
}

/**
Expand Down Expand Up @@ -76,7 +76,7 @@ public function getTags()
*/
protected function getCurrentBranch()
{
$headFile = $this->gitRootDir . '/HEAD';
$headFile = $this->data["git_root"] . '/HEAD';
$branch = null;

if (file_exists($headFile)) {
Expand Down Expand Up @@ -120,7 +120,7 @@ protected function getRefsBranches()
protected function getLocalBranches($ref = null)
{
$branches = array();
$base = $this->gitRootDir . '/refs/heads';
$base = $this->data["git_root"] . '/refs/heads';
$path = $base . (!empty($ref) ? "/{$ref}" : '');
$files = glob("{$path}/*");

Expand Down Expand Up @@ -162,7 +162,7 @@ protected function getRefsTags()
protected function getLocalTags($ref = null)
{
$tags = array();
$base = $this->gitRootDir . '/refs/tags';
$base = $this->data["git_root"] . '/refs/tags';
$path = $base . (!empty($ref) ? "/{$ref}" : '');
$files = glob("{$path}/*");

Expand All @@ -188,7 +188,7 @@ protected function getRefsInfo()
return $this->refsInfo;
}

$refsFile = $this->gitRootDir . '/packed-refs';
$refsFile = $this->data["git_root"] . '/packed-refs';
$refs = array();

if (file_exists($refsFile)) {
Expand Down

0 comments on commit 3128a53

Please sign in to comment.