Skip to content

Commit

Permalink
FIX GitFetch remote HEAD save error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rohde committed May 23, 2024
1 parent 1fb0fae commit 6182aae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Service/GitFetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Rodziu\Git\Manager\GitRepositoryManager;
use Rodziu\Git\Object\GitRef;
use Rodziu\Git\Object\Head;
use Rodziu\Git\Util\FileSystemUtil;

readonly class GitFetch
{
Expand Down Expand Up @@ -83,6 +84,7 @@ public function getHavesAndWants(array $repositoryInfo): array
public function updateRefs(array $repositoryInfo, string $remote): void
{
$headPath = $this->manager->resolvePath('refs', 'remotes', $remote, 'HEAD');
FileSystemUtil::mkdirIfNotExists(dirname($headPath));
file_put_contents($headPath, $repositoryInfo['head']->getCommitHash().PHP_EOL);

$this->manager->getRefReader()
Expand Down

0 comments on commit 6182aae

Please sign in to comment.