Method

GgitTreeBuilderinsert

Declaration [src]

GgitTreeEntry*
ggit_tree_builder_insert (
  GgitTreeBuilder* builder,
  const gchar* filename,
  GgitOId* oid,
  GgitFileMode file_mode,
  GError** error
)

Description [src]

Insert a file with a given blob in the tree builder. If the tree builder already contains an entry for the given file, then this entry will be overwritten.

Note that the returned GgitTreeEntry is bound to the lifetime of the tree builder and cannot be used after the tree builder has been freed.

Parameters

filename const gchar*
 

The file name.

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

The GgitOId of the file blob to insert.

 The data is owned by the caller of the function.
file_mode GgitFileMode
 

A GgitFileMode.

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

Return value

Returns: GgitTreeEntry
 

A GgitTreeEntry or NULL.

 The caller of the method takes ownership of the data, and is responsible for freeing it.
 The return value can be NULL.