CIME.utils.get_current_branch
- CIME.utils.get_current_branch(repo=None)[source]
Return the name of the current branch for a repository. Returns None if there’s any problem.
>>> if "GIT_BRANCH" in os.environ: ... get_current_branch() is not None ... else: ... os.environ["GIT_BRANCH"] = "foo" ... get_current_branch() == "foo" True