'Create a commit object in the pack.  The date_sec values must be
epoch-seconds, and if a tz is None, the local timezone is assumed.'

def new_commit(self, tree, parent, author, adate_sec, adate_tz, committer, cdate_sec, cdate_tz, msg):

    if adate_tz:
        adate_str = _git_date_str(adate_sec, adate_tz)
    else:
        adate_str = _local_git_date_str(adate_sec)
    if cdate_tz:
        cdate_str = _git_date_str(cdate_sec, cdate_tz)
    else:
        cdate_str = _local_git_date_str(cdate_sec)
    l = []
    if tree:
        l.append(('tree    %s' % tree.encode('hex')))
    if parent:
        l.append(('parent    %s' % parent.encode('hex')))
    if author:
        l.append(('author    %s    %s' % (author, adate_str)))
    if committer:
        l.append(('committer    %s    %s' % (committer, cdate_str)))
    l.append('')
    l.append(msg)
    return self.maybe_write('commit', '\n'.join(l))
