# Buggy code
def branch_relatives(self, branch):
    # type: (str) -> List[str]
    """Get list of all relatives from ``git show-branch`` results"""
    output = self.git("show-branch", "--no-color")

    prelude, body = re.split(r"^-+$", output, flags=re.M)

    match = re.search(r"^(\s+)\*", prelude, re.M)
    if not match:
        print("branch {} not found in header information".format(branch))
        return []

    branch_column = len(match.group(1))
    relatives = []  # type: List[str]
    for line in filter(None, body.splitlines()):  # type: str
        if line[branch_column] != " ":
            match = EXTRACT_BRANCH_NAME.match(line)
            if match:
                branch_name = match.group(1)
                if branch_name != branch and branch_name not in relatives:
                    relatives.append(branch_name)

    return relatives


# Traceback (ValueError)
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 1052, in run_
return self.run()
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/core/interfaces/rebase.py", line 48, in run
RebaseInterface(repo_path=self.repo_path)
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/core/interfaces/rebase.py", line 134, in __init__
super().__init__(*args, **kwargs)
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/common/ui.py", line 87, in __init__
self.create_view(repo_path)
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/common/ui.py", line 115, in create_view
self.render()
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/common/ui.py", line 131, in render
rendered = self._render_template()
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/common/ui.py", line 149, in _render_template
keyed_content = self.get_keyed_content()
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/common/ui.py", line 187, in get_keyed_content
for key, render_fn in self.partials.items()
File "./python3.3/collections/__init__.py", line 56, in __init__
File "./python3.3/collections/abc.py", line 578, in update
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/common/ui.py", line 187, in <genexpr>
for key, render_fn in self.partials.items()
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/core/interfaces/rebase.py", line 200, in render_diverged_commits
start=self.base_commit(),
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/core/interfaces/rebase.py", line 356, in base_commit
base_ref = self.base_ref()
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/core/interfaces/rebase.py", line 329, in base_ref
default=remote_branch or "master")
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/core/git_mixins/rebase.py", line 60, in nearest_branch
relatives = self.branch_relatives(branch)
File "/Users/pavel.savchenko/Library/Application Support/Sublime Text 3/Packages/GitSavvy/core/git_mixins/rebase.py", line 23, in branch_relatives
prelude, body = re.split(r'^-+$', output, flags=re.M)
ValueError: need more than 1 value to unpack

# Fixed code
def branch_relatives(self, branch):
    # type: (str) -> List[str]
    """Get list of all relatives from ``git show-branch`` results"""
    output = self.git("show-branch", "--no-color")  # type: str

    try:
        prelude, body = re.split(r"^-+$", output, flags=re.M)
    except ValueError:
        # If there is only one branch, git changes the output format
        # and omits the prelude and column indicator.
        lines = filter(None, output.splitlines())
    else:
        match = re.search(r"^(\s+)\*", prelude, re.M)
        if not match:
            print("branch {} not found in header information".format(branch))
            return []

        branch_column = len(match.group(1))
        lines = (
            line
            for line in filter(None, body.splitlines())
            if line[branch_column] != " "
        )

    relatives = []  # type: List[str]
    for line in lines:
        match = EXTRACT_BRANCH_NAME.match(line)
        if match:
            branch_name = match.group(1)
            if branch_name != branch and branch_name not in relatives:
                relatives.append(branch_name)

    return relatives