MCPcopy Create free account
hub / github.com/METR/vivaria / get_branch

Function get_branch

cli/viv_cli/github.py:86–95  ·  view source on GitHub ↗

Get the current branch. Returns: The current branch, or None if detached head.

()

Source from the content-addressed store, hash-verified

84
85
86def get_branch() -> str | None:
87 """Get the current branch.
88
89 Returns:
90 The current branch, or None if detached head.
91 """
92 branch = execute("git rev-parse --abbrev-ref HEAD", error_out=True).out
93 if branch == "HEAD": # detached head
94 return None
95 return branch
96
97
98def create_working_tree_permalink(

Callers 1

Calls 1

executeFunction · 0.90

Tested by

no test coverage detected