1
0
Fork 0

Ensure to get only the right branch

This commit is contained in:
Luca Beltrame 2022-01-15 17:00:16 +01:00
parent 9f02b1f264
commit fdd85c9509
Signed by: einar
GPG key ID: 4707F46E9EC72DEC

View file

@ -45,7 +45,8 @@ def project_exists(project: str) -> bool:
def get_remote_hash(url: str, branch: str = "master") -> str: def get_remote_hash(url: str, branch: str = "master") -> str:
gitcmd = git.cmd.Git() gitcmd = git.cmd.Git()
revision = gitcmd.ls_remote(url, branch, quiet=True, refs=True) revision = gitcmd.ls_remote(url, f"refs/heads/{branch}",
quiet=True, refs=True)
git_hash, branch = revision.split("\t") git_hash, branch = revision.split("\t")
return git_hash return git_hash