Skip to content

Commit

Permalink
fixes #13: If not using HEAD, fetch the current branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsqd committed Jul 31, 2024
1 parent a4ed823 commit aafc56a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Robo/Plugin/Commands/ValidateCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,14 @@ public function validateCommitMessages(
var_dump('CURRENT BRANCH:');
if ($current_branch !== 'HEAD') {
$current_branch = "$git_remote/$current_branch";
// Fetch the latest in the target branch.
if (!$this->_exec(
"git fetch $git_remote $target_branch:refs/remotes/$current_branch"
)->wasSuccessful()) {
$this->printError('Unable to fetch the current branch.');

return new ResultData(ResultData::EXITCODE_ERROR);
}
}
var_dump($current_branch);
$git_command = "git log $git_remote/$target_branch...$current_branch --pretty=format:%s --no-merges";
Expand Down

0 comments on commit aafc56a

Please sign in to comment.