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 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 GgitSignature
 

Author signature.

 The data is owned by the caller of the function.
committer GgitSignature
 

Committer signature (and time of commit).

 The data is owned by the caller of the function.
message_encoding 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 const gchar*
 

Commit message.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
tree GgitTree
 

The tree of objects to commit.

 The data is owned by the caller of the function.
parents An array of GgitCommit*
 

Parent commits.

 The length of the array is specified in the parent_count argument.
 The data is owned by the caller of the function.
parent_count gint
 

Number of parent commits in parents.

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: 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.