(tmp_path: Path)
| 950 | |
| 951 | |
| 952 | def test_open_extended(tmp_path: Path) -> None: |
| 953 | with utils.TemporaryRepository('dirtyrepo.zip', tmp_path) as path: |
| 954 | orig_repo = pygit2.Repository(path) |
| 955 | assert not orig_repo.is_bare |
| 956 | assert orig_repo.path |
| 957 | assert orig_repo.workdir |
| 958 | |
| 959 | # GIT_REPOSITORY_OPEN_NO_SEARCH |
| 960 | subdir_path = path / 'subdir' |
| 961 | repo = pygit2.Repository(subdir_path) |
| 962 | assert not repo.is_bare |
| 963 | assert repo.path == orig_repo.path |
| 964 | assert repo.workdir == orig_repo.workdir |
| 965 | |
| 966 | with pytest.raises(pygit2.GitError): |
| 967 | repo = pygit2.Repository(subdir_path, RepositoryOpenFlag.NO_SEARCH) |
| 968 | |
| 969 | # GIT_REPOSITORY_OPEN_NO_DOTGIT |
| 970 | gitdir_path = path / '.git' |
| 971 | with pytest.raises(pygit2.GitError): |
| 972 | repo = pygit2.Repository(path, RepositoryOpenFlag.NO_DOTGIT) |
| 973 | |
| 974 | repo = pygit2.Repository(gitdir_path, RepositoryOpenFlag.NO_DOTGIT) |
| 975 | assert not repo.is_bare |
| 976 | assert repo.path == orig_repo.path |
| 977 | assert repo.workdir == orig_repo.workdir |
| 978 | |
| 979 | # GIT_REPOSITORY_OPEN_BARE |
| 980 | repo = pygit2.Repository(gitdir_path, RepositoryOpenFlag.BARE) |
| 981 | assert repo.is_bare |
| 982 | assert repo.path == orig_repo.path |
| 983 | assert not repo.workdir |
| 984 | |
| 985 | |
| 986 | def test_is_shallow(testrepo: Repository) -> None: |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…