'Determine which git branch a local repository is in.
Args:
name [string]: The repository name.
Returns:
The name of the branch.'

def get_local_branch_name(self, name):

    result = run_quick('git    -C    "{dir}"    rev-parse    --abbrev-ref    HEAD'.format(dir=get_repository_dir(name)), echo=False)
    if result.returncode:
        error = ('Could    not    determine    branch:    ' + result.stdout.strip())
        raise RuntimeError(error)
    return result.stdout.strip()
