|
12 | 12 | from typing import Any |
13 | 13 | from typing import Iterator |
14 | 14 |
|
15 | | -import dulwich.repo |
16 | 15 | import httpretty |
17 | 16 | import keyring |
18 | 17 | import pytest |
|
45 | 44 | from tests.helpers import mock_clone |
46 | 45 | from tests.helpers import switch_working_directory |
47 | 46 | from tests.helpers import with_working_directory |
48 | | -from tests.vcs.git.git_fixture import TempRepoFixture |
49 | 47 |
|
50 | 48 |
|
51 | 49 | if TYPE_CHECKING: |
@@ -584,49 +582,3 @@ def project_context(project: str | Path, in_place: bool = False) -> Iterator[Pat |
584 | 582 | yield path |
585 | 583 |
|
586 | 584 | return project_context |
587 | | - |
588 | | - |
589 | | -@pytest.fixture() |
590 | | -def temp_repo(tmp_path: Path) -> TempRepoFixture: |
591 | | - """Temporary repository with 2 commits""" |
592 | | - repo = dulwich.repo.Repo.init(str(tmp_path)) |
593 | | - |
594 | | - # init commit |
595 | | - (tmp_path / "foo").write_text("foo", encoding="utf-8") |
596 | | - repo.stage(["foo"]) |
597 | | - |
598 | | - init_commit = repo.do_commit( |
599 | | - committer=b"User <user@example.com>", |
600 | | - author=b"User <user@example.com>", |
601 | | - message=b"init", |
602 | | - no_verify=True, |
603 | | - ) |
604 | | - |
605 | | - # one commit which is not "head" |
606 | | - (tmp_path / "bar").write_text("bar", encoding="utf-8") |
607 | | - repo.stage(["bar"]) |
608 | | - middle_commit = repo.do_commit( |
609 | | - committer=b"User <user@example.com>", |
610 | | - author=b"User <user@example.com>", |
611 | | - message=b"extra", |
612 | | - no_verify=True, |
613 | | - ) |
614 | | - |
615 | | - # extra commit |
616 | | - (tmp_path / "third").write_text("third file", encoding="utf-8") |
617 | | - repo.stage(["third"]) |
618 | | - |
619 | | - head_commit = repo.do_commit( |
620 | | - committer=b"User <user@example.com>", |
621 | | - author=b"User <user@example.com>", |
622 | | - message=b"extra", |
623 | | - no_verify=True, |
624 | | - ) |
625 | | - |
626 | | - return TempRepoFixture( |
627 | | - path=tmp_path, |
628 | | - repo=repo, |
629 | | - init_commit=init_commit.decode(), |
630 | | - middle_commit=middle_commit.decode(), |
631 | | - head_commit=head_commit.decode(), |
632 | | - ) |
0 commit comments