(
barerepo: Repository, tmp_path: Path
)
| 747 | |
| 748 | |
| 749 | def test_clone_repository_and_remote_callbacks( |
| 750 | barerepo: Repository, tmp_path: Path |
| 751 | ) -> None: |
| 752 | url = Path(barerepo.path).resolve().as_uri() |
| 753 | repo_path = tmp_path / 'clone-into' |
| 754 | |
| 755 | def create_repository(path: Path, bare: bool) -> Repository: |
| 756 | return init_repository(path, bare) |
| 757 | |
| 758 | # here we override the name |
| 759 | def create_remote(repo: Repository, name: str, url: str) -> Remote: |
| 760 | return repo.remotes.create('custom_remote', url) |
| 761 | |
| 762 | repo = clone_repository( |
| 763 | url, repo_path, repository=create_repository, remote=create_remote |
| 764 | ) |
| 765 | assert not repo.is_empty |
| 766 | assert 'refs/remotes/custom_remote/master' in repo.listall_references() |
| 767 | assert b'refs/remotes/custom_remote/master' in repo.raw_listall_references() |
| 768 | assert repo.remotes['custom_remote'] is not None |
| 769 | |
| 770 | |
| 771 | @utils.requires_network |
nothing calls this directly
no test coverage detected
searching dependent graphs…