+ set_head = True
+
+ if commit:
+ # create a commit for the patch (may be empty if top == bottom);
+ # only commit on top of the current branch
+ assert(commit and bottom == head)
+ top_commit = git.get_commit(top)
+ commit_id = git.commit(message = descr, parents = [bottom],
+ cache_update = False,
+ tree_id = top_commit.get_tree(),
+ allowempty = True, set_head = set_head,
+ author_name = author_name,
+ author_email = author_email,
+ author_date = author_date,
+ committer_name = committer_name,
+ committer_email = committer_email)
+ # set the patch top to the new commit
+ patch.set_top(commit_id)
+
+ self.log_patch(patch, 'new')