mirror of
https://github.com/peridotbuild/pv2.git
synced 2024-11-21 12:41:26 +00:00
importer: Address upstream hash ref list issue
There are cases where upstream (stream 10 for example) have repos for packages that they plan or will ship, but there are no references associated. Meaning, there's no branches, there's no data, nothing to work off of.
This commit is contained in:
parent
7f2004719a
commit
ff35a29d08
@ -139,8 +139,11 @@ def tag(repo, tag_name:str, message: str):
|
||||
|
||||
def lsremote(url):
|
||||
"""
|
||||
Helps check if a repo exists, and if it does, return references. If not,
|
||||
return None and assume it doesn't exist.
|
||||
Helps check if a repo exists.
|
||||
|
||||
If repo exists: return references
|
||||
If repo exists and is completely empty: return empty dict
|
||||
If repo does not exist: return None
|
||||
"""
|
||||
remote_refs = {}
|
||||
git_cmd = rawgit.cmd.Git()
|
||||
@ -153,5 +156,6 @@ def lsremote(url):
|
||||
|
||||
for ref in git_cmd.ls_remote(url).split('\n'):
|
||||
hash_ref_list = ref.split('\t')
|
||||
remote_refs[hash_ref_list[1]] = hash_ref_list[0]
|
||||
if len(hash_ref_list) > 1:
|
||||
remote_refs[hash_ref_list[1]] = hash_ref_list[0]
|
||||
return remote_refs
|
||||
|
Loading…
Reference in New Issue
Block a user