def test_git_local_info(source_url: str, remote_refs: FetchPackResult,
                        remote_default_ref: bytes) -> None:
    with Git.clone(url=source_url) as repo:
        info = Git.info(repo=repo)
        assert info.origin == source_url
        assert info.revision == remote_refs.refs[remote_default_ref].decode(
            "utf-8")
Exemple #2
0
    def get_package_vcs_properties_from_path(
            cls, src: Path) -> tuple[str, str, str]:
        from poetry.vcs.git import Git

        info = Git.info(repo=src)
        return "git", info.origin, info.revision