'Selects a local branch by index in the list view'

def select_local_branch(self, idx):

    item = self.local_branches.item(idx)
    if item:
        item.setSelected(True)
        self.local_branches.setCurrentItem(item)
        self.local_branch.setText(item.text())
        result = True
    else:
        result = False
    return result
