INNER CODE UNIT · Python
update_branch_reference
DmitryRyumin/ICCV-2023-25-Papers · code/markdown_to_json_parser.py:84
def update_branch_reference(repo, commit_sha):
try:
repo.get_git_ref(f"heads/{repo.default_branch}").edit(commit_sha)
except Exception as e:
print(f"Error updating branch reference: {e}")
def commit_and_update_branch(g, repo, latest_commit, tree):
try:
committer = InputGitAuthor(
name=g.get_user().name,
email=g.get_user().email,
)
commit = repo.create_git_commit(
message=Config.COMMIT_MESSAGE,
tree=tree,
parents=[latest_commit],