'Retrieve the parents of a specific commit.
If the specific commit is a graftpoint, the graft parents
will be returned instead.
:param sha: SHA of the commit for which to retrieve the parents
:param commit: Optional commit matching the sha
:return: List of parents'

def get_parents(self, sha, commit=None):

    try:
        return self._graftpoints[sha]
    except KeyError:
        if (commit is None):
            commit = self[sha]
        return commit.parents
