Skip to content

Commit

Permalink
[5.x] Prevent logging "remote: Processed 1 references in total" Git e…
Browse files Browse the repository at this point in the history
…rrors (#10332)
  • Loading branch information
duncanmcclean authored Jun 19, 2024
1 parent 809853f commit 55f92fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Console/Processes/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ protected function prepareErrorOutput($type, $buffer)
$ignore = [
'remote: Resolving deltas',
'Permanently added the ECDSA host key for IP address',
'remote: Processed',
];

if (Str::contains($buffer, $ignore)) {
Expand Down
8 changes: 8 additions & 0 deletions tests/Git/GitProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ public function it_doesnt_log_added_host_key_to_known_hosts_as_error_output()
$this->simulateLoggableErrorOutput("Permanently added the ECDSA host key for IP address '127.0.0.1' to the list of known hosts.");
}

/** @test */
public function it_doesnt_log_processed_references_as_error_output()
{
Log::shouldReceive('error')->never();

$this->simulateLoggableErrorOutput('remote: Processed 1 references in total');
}

private function showLastCommit($path)
{
return Process::create($path)->run('git show');
Expand Down

0 comments on commit 55f92fb

Please sign in to comment.