diff --git a/obs/update_unstable.py b/obs/update_unstable.py index 1fda970..a1f600e 100755 --- a/obs/update_unstable.py +++ b/obs/update_unstable.py @@ -75,20 +75,12 @@ def project_exists(project: str) -> bool: return False -def lsremote(url: str) -> Dict[str, str]: - - remote_refs = {} - gitcmd = git.cmd.Git() - for ref in gitcmd.ls_remote(url).split('\n'): - hash_ref_list = ref.split('\t') - remote_refs[hash_ref_list[1]] = hash_ref_list[0] - - return remote_refs - - def get_remote_hash(url: str, branch: str = "master") -> str: - refs = "refs/heads/{}".format(branch) - return lsremote(url)[refs] + + gitcmd = git.cmd.Git() + revision = gitcmd.ls_remote(url, branch, quiet=True, refs=True) + git_hash, branch = revision.split("\t") + return git_hash def trigger_update(repository: str, package_name: str,