Skip to content

Commit

Permalink
fix: conventional commit wakeup class parse
Browse files Browse the repository at this point in the history
Closes: #3
  • Loading branch information
Marco Cesarato committed Feb 10, 2021
1 parent a48597b commit 9eb3fbe
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/Git/ConventionalCommit.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,6 @@ class ConventionalCommit extends Commit
public function __construct(?string $commit = null)
{
parent::__construct($commit);

// New commit or empty commit
if (empty($commit)) {
return;
}

// Not parsable
if (!$this->isValid()) {
return;
}

$this->__wakeup();
}

Expand Down Expand Up @@ -240,6 +229,16 @@ public function setFooters(array $footers): self

public function __wakeup()
{
// Empty
if (empty($this->raw)) {
return;
}

// Not parsable
if (!$this->isValid()) {
return;
}

$rows = explode("\n", $this->raw);
$header = $rows[0];
$message = '';
Expand Down

0 comments on commit 9eb3fbe

Please sign in to comment.