'Scan across staged, modified, etc. and return a single item.'

def single_selection(self):

    st = None
    um = None
    m = None
    ut = None
    s = self.selection()
    if s.staged:
        st = s.staged[0]
    elif s.modified:
        m = s.modified[0]
    elif s.unmerged:
        um = s.unmerged[0]
    elif s.untracked:
        ut = s.untracked[0]
    return selection.State(st, um, m, ut)
