Skip to content

Commit

Permalink
Regression test for broken dulwich checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjalbert committed Apr 13, 2022
1 parent 4e12203 commit baae07d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_repo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from pathlib import Path

from pcs.component import Component
from pcs.repo import LocalRepo, Repo
from tests.utils import (
Expand Down Expand Up @@ -43,3 +45,20 @@ def test_local_to_from_registry():
repo_from_reg = Repo.from_registry(reg, "test_id")
assert repo.identifier == repo_from_reg.identifier
assert repo.local_dir == repo_from_reg.local_dir


def test_repo_checkout_bug():
aos_repo = Repo.from_github("agentos-project", "agentos")
pcs_component_path = Path("pcs") / Path("component.py")
# pcs/component.py exists in 4e12203
exists_version = "4e12203faaf84361af9432271e013ddfb927f75d"
exists_path = aos_repo.get_local_file_path(
pcs_component_path, version=exists_version
)
assert exists_path.exists()
# pcs/component.py does NOT exist in 07bc713
not_exists_version = "07bc71358b4360092b58d78f9eee6dc939e90b10"
not_exists_path = aos_repo.get_local_file_path(
pcs_component_path, version=not_exists_version
)
assert not not_exists_path.exists()

0 comments on commit baae07d

Please sign in to comment.