Skip to content

Commit 8133e71

Browse files
committed
bisect: advertise gzip,deflate encoding when supported
1 parent da259bd commit 8133e71

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/Command/BisectCommand.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,25 @@ protected function execute(InputInterface $input, OutputInterface $output): int
106106
return 1;
107107
}
108108

109+
$headers = [
110+
'Authorization' => 'token ' . $token,
111+
'Accept' => 'application/vnd.github.v3+json',
112+
];
113+
if (extension_loaded('zlib')) {
114+
$headers['Accept-Encoding'] = 'gzip,deflate';
115+
}
116+
109117
$client = new Client([
110118
RequestOptions::TIMEOUT => 30,
111119
RequestOptions::CONNECT_TIMEOUT => 10,
112-
'headers' => [
113-
'Authorization' => 'token ' . $token,
114-
'Accept' => 'application/vnd.github.v3+json',
115-
],
120+
'headers' => $headers
116121
]);
117122

118123
$io->section(sprintf('Fetching commits between %s and %s...', $good, $bad));
119124

120125
try {
121126
$commits = $this->getCommitsBetween($client, $good, $bad);
127+
exit();
122128
} catch (GuzzleException $e) {
123129
$io->error(sprintf('Failed to fetch commits from GitHub: %s', $e->getMessage()));
124130
return 1;

0 commit comments

Comments
 (0)