CIME.utils.get_current_branch

CIME.utils.get_current_branch(repo=None)[source]

Return the name of the current branch for a repository

>>> if "GIT_BRANCH" in os.environ:
...     get_current_branch() is not None
... else:
...     os.environ["GIT_BRANCH"] = "foo"
...     get_current_branch() == "foo"
True