forked from importers/git-importer
reconstruct state data
If the state file is missing, we can reconstruct which parts were exported based on revision ids Also, packages could have branches in Git, but not be in Git. We need to check (project,package) tuple for this and not just abort based on the package name alone.
This commit is contained in:
@@ -160,6 +160,12 @@ class Git:
|
||||
.strip()
|
||||
)
|
||||
|
||||
def branch_commit(self, branch="HEAD"):
|
||||
try:
|
||||
return (self.git_run(["cat-file", "commit", branch], stdout=subprocess.PIPE).stdout.decode("utf-8").strip())
|
||||
except:
|
||||
return ''
|
||||
|
||||
def set_branch_head(self, branch, commit):
|
||||
return self.git_run(["update-ref", f"refs/heads/{branch}", commit])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user