Method

GgitRepositorycreate_index_entry_for_path

Declaration [src]

GgitIndexEntry*
ggit_repository_create_index_entry_for_path (
  GgitRepository* repository,
  const gchar* path,
  GgitOId* id,
  GError** error
)

Description [src]

Create a new index entry. When path is not NULL, the path of the returned entry (#ggit_index_entry_get_path) is set to path. The specified path can be either absolute or relative. In the case of an absolute path, the path must reside within the working directory of repository. The file related fields of the returned entry are also queried from this path (if the file exists).

If id is not NULL, then the id of the returned entry is set to id (see #ggit_index_entry_get_id) which could point to a blob (for a file) or a tree (for a directory).

Parameters

path const gchar*
 

A path.

 The argument can be NULL.
 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
id GgitOId
 

A GgitOId.

 The argument can be NULL.
 The data is owned by the caller of the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GgitIndexEntry
 

A GgitIndexEntry or NULL when an error occurred.

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