Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/Gitonomy/Git/Tests/BlobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ public function testGetContent(Repository $repository): void
$this->assertStringContainsString(self::README_FRAGMENT, $blob->getContent());
}

#[DataProvider('provideFoobar')]
public function testGetContentSiblingToSubmodule(Repository $repository): void
{
// Regression test for https://github.com/gitonomy/gitlib/issues/12:
// a submodule entry in a tree used to break parsing of that tree,
// making sibling blobs unreadable.
$tree = $repository->getCommit(self::NO_MESSAGE_COMMIT)->getTree();

$this->assertNotEmpty($tree->getCommitReferenceEntries(), 'Tree contains a submodule entry');

$blob = $tree->resolvePath('README.md');

$this->assertStringContainsString(self::README_FRAGMENT, $blob->getContent());
}

#[DataProvider('provideFoobar')]
public function testNotExisting(Repository $repository): void
{
Expand Down