Method
GgitRepositorycreate_commit
Declaration [src]
GgitOId*
ggit_repository_create_commit (
GgitRepository* repository,
const gchar* update_ref,
GgitSignature* author,
GgitSignature* committer,
const gchar* message_encoding,
const gchar* message,
GgitTree* tree,
GgitCommit** parents,
gint parent_count,
GError** error
)
Description [src]
Create a new commit. If update_ref is not NULL, the given reference will
be updated to point to the newly created commit. Use “HEAD” to update the
HEAD of the current branch and make it point to this commit.
If message_encoding is set to NULL, “UTF-8” encoding is assumed for the
provided message. Note that message will not be cleaned up automatically.
You can use #ggit_message_prettify to do this yourself if needed.
Parameters
update_ref-
Type:
const gchar*Name of the reference to update.
The argument can be NULL.The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. author-
Type:
GgitSignatureAuthor signature.
The data is owned by the caller of the function. committer-
Type:
GgitSignatureCommitter signature (and time of commit).
The data is owned by the caller of the function. message_encoding-
Type:
const gchar*Message encoding.
The argument can be NULL.The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. message-
Type:
const gchar*Commit message.
The data is owned by the caller of the function. The value is a NUL terminated UTF-8 string. tree-
Type:
GgitTreeThe tree of objects to commit.
The data is owned by the caller of the function. parents-
Type: An array of
GgitCommit*Parent commits.
The length of the array is specified in the parent_countargument.The data is owned by the caller of the function. parent_count-
Type:
gintNumber of parent commits in
parents. error-
Type:
GError **The return location for a recoverable error.
The argument can be NULL.If the return location is not NULL, then you must initialize it to aNULLGError*.The argument will left initialized to NULLby the method if there are no errors.In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.
Return value
Type: GgitOId
The GgitOId of the created commit object,
or NULL in case of an error.
| The caller of the method takes ownership of the data, and is responsible for freeing it. |
The return value can be NULL. |