Skip to content

Commit

Permalink
Fix computed data not assinged to cache (#224)
Browse files Browse the repository at this point in the history
Fix assinging two data types to the same variable

Fix calling of removed functions that would just return null
  • Loading branch information
Patrick-Beuks authored May 21, 2024
1 parent 0853cb9 commit 5fa8b85
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Gitonomy/Git/Commit.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ private function getData($name)
array_shift($lines);
array_shift($lines);

$data['bodyMessage'] = implode("\n", $lines);
$this->data['bodyMessage'] = implode("\n", $lines);

return $data['bodyMessage'];
return $this->data['bodyMessage'];
}

$parser = new Parser\CommitParser();
Expand Down
4 changes: 2 additions & 2 deletions src/Gitonomy/Git/Parser/CommitParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ protected function doParse()
$this->consumeNewLine();

$this->consume('committer ');
list($this->committerName, $this->committerEmail, $this->committerDate) = $this->consumeNameEmailDate();
$this->committerDate = $this->parseDate($this->committerDate);
list($this->committerName, $this->committerEmail, $committerDate) = $this->consumeNameEmailDate();
$this->committerDate = $this->parseDate($committerDate);

// will consume an GPG signed commit if there is one
$this->consumeGPGSignature();
Expand Down
8 changes: 4 additions & 4 deletions src/Gitonomy/Git/Parser/LogParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ protected function doParse()
}

$this->consume('author ');
list($commit['authorName'], $commit['authorEmail'], $commit['authorDate']) = $this->consumeNameEmailDate();
$commit['authorDate'] = $this->parseDate($commit['authorDate']);
list($commit['authorName'], $commit['authorEmail'], $authorDate) = $this->consumeNameEmailDate();
$commit['authorDate'] = $this->parseDate($authorDate);
$this->consumeNewLine();

$this->consume('committer ');
list($commit['committerName'], $commit['committerEmail'], $commit['committerDate']) = $this->consumeNameEmailDate();
$commit['committerDate'] = $this->parseDate($commit['committerDate']);
list($commit['committerName'], $commit['committerEmail'], $committerDate) = $this->consumeNameEmailDate();
$commit['committerDate'] = $this->parseDate($committerDate);

// will consume an GPG signed commit if there is one
$this->consumeGPGSignature();
Expand Down
4 changes: 2 additions & 2 deletions src/Gitonomy/Git/Parser/TagParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ protected function doParse()
$this->consumeNewLine();

$this->consume('tagger ');
list($this->taggerName, $this->taggerEmail, $this->taggerDate) = $this->consumeNameEmailDate();
$this->taggerDate = $this->parseDate($this->taggerDate);
list($this->taggerName, $this->taggerEmail, $taggerDate) = $this->consumeNameEmailDate();
$this->taggerDate = $this->parseDate($taggerDate);

$this->consumeNewLine();
$this->consumeNewLine();
Expand Down
4 changes: 2 additions & 2 deletions src/Gitonomy/Git/Reference/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ private function getData($name)
array_shift($lines);
array_pop($lines);

$data['bodyMessage'] = implode("\n", $lines);
$this->data['bodyMessage'] = implode("\n", $lines);

return $data['bodyMessage'];
return $this->data['bodyMessage'];
}

$parser = new TagParser();
Expand Down
6 changes: 1 addition & 5 deletions src/Gitonomy/Git/ReferenceBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,7 @@ protected function initialize()
$parser = new Parser\ReferenceParser();
$output = $this->repository->run('show-ref');
} catch (RuntimeException $e) {
$output = $e->getOutput();
$error = $e->getErrorOutput();
if ($error) {
throw new RuntimeException('Error while getting list of references: '.$error);
}
$output = null;
}
$parser->parse($output);

Expand Down

0 comments on commit 5fa8b85

Please sign in to comment.