def get_commit(repo, name):
    # Handle the special internal commit names COMMIT_INDEX and COMMIT_WD
    if name == constants.COMMIT_INDEX:
        return get_index_commit(repo)
    elif name == constants.COMMIT_WD:
        return get_working_dir_commit(repo)

    # Get the SHA1 value for this commit.
    sha1 = repo.getCommitSha1(name)

    # Run "git cat-file commit <name>"
    cmd = ['cat-file', 'commit', str(name)]
    out = repo.runSimpleGitCmd(cmd)

    # Split the header and body
    try:
        (header, body) = out.split('\n\n', 1)
    except __HOLE__:
        # split() resulted in just one value
        # Treat it as headers, with an empty body
        header = out
        if header and header[-1] == '\n':
            header = header[:-1]
        body = ''

    # Parse the header
    (tree, parents, author, committer) = _parse_header(name, header)

    return Commit(repo, sha1, tree, parents, author, committer, body)
dataset/ETHPy150Open facebookarchive/git-review/src/gitreview/git/commit.py/get_commit