'Parse output of git branch -r
e.g.:
origin/2.0.X
origin/HEAD -> origin/master
origin/develop
origin/master
origin/release/2.0.0
origin/release/2.1.0'

def parse_branches(self, data):

    clean_branches = []
    if (not isinstance(data, str)):
        data = str(data)
    raw_branches = csv.reader(StringIO(data), delimiter='    ')
    for branch in raw_branches:
        branch = [f for f in branch if ((f != '') and (f != '*'))]
        if branch:
            branch = branch[0]
            if branch.startswith('origin/'):
                cut_len = len('origin/')
                slug = branch[cut_len:].replace('/', '-')
                if (slug in ['HEAD']):
                    continue
                clean_branches.append(VCSVersion(self, branch, slug))
            else:
                slug = branch.replace('/', '-')
                clean_branches.append(VCSVersion(self, branch, slug))
    return clean_branches
