MCPcopy Create free account
hub / github.com/apache/tvm / update_branch

Function update_branch

ci/scripts/github/update_branch.py:138–150  ·  view source on GitHub ↗
(user: str, repo: str, sha: str, branch_name: str)

Source from the content-addressed store, hash-verified

136
137
138def update_branch(user: str, repo: str, sha: str, branch_name: str) -> None:
139 git(["fetch", "origin", sha])
140 git(["reset", "--hard", "FETCH_HEAD"])
141 try:
142 git(["branch", "-D", branch_name])
143 except RuntimeError:
144 # Ignore failures (i.e. the branch did not exist in the first place)
145 pass
146 git(["checkout", "-b", branch_name])
147
148 # Create and push the branch
149 git(["push", "origin", "--force", branch_name])
150 print(f"Pushed branch {branch_name} with commit {sha}")
151
152
153if __name__ == "__main__":

Callers 1

update_branch.pyFile · 0.85

Calls 2

gitFunction · 0.90
printFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…