Skip to content

Commit

Permalink
fix: clone gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n committed Nov 15, 2023
1 parent f135291 commit 5677e55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/VCS/Adapter/Git/GitHub.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ public function createRepository(string $owner, string $repositoryName, bool $pr
*
* @throws Exception
*/
public function searchRepositories(string $owner, int $page, int $per_page, string $search=''): array
public function searchRepositories(string $owner, int $page, int $per_page, string $search = ''): array
{
$url = '/search/repositories';

$response = $this->call(self::METHOD_GET, $url, ['Authorization' => "Bearer $this->accessToken"], [
'q' => "{$search} user:{$owner} fork:true",
'per_page' => $per_page,
'sort' => 'updated'
]);
]);

if (!isset($response['body']['items'])) {
throw new Exception("Repositories list missing in the response.");
Expand Down Expand Up @@ -488,6 +488,7 @@ public function generateCloneCommand(string $owner, string $repositoryName, stri
"git init",
"git remote add origin {$cloneUrl}",
"git config core.sparseCheckout true",
"echo '{$rootDirectory}/.gitignore' >> .git/info/sparse-checkout",
"echo {$rootDirectory} >> .git/info/sparse-checkout",
];

Expand Down

0 comments on commit 5677e55

Please sign in to comment.