![]() |
![]() |
![]() |
libgit2-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
GgitIndex; struct GgitIndexClass; GgitIndex * ggit_index_open (GFile *file
,GError **error
); gboolean ggit_index_read (GgitIndex *idx
,GError **error
); gboolean ggit_index_write (GgitIndex *idx
,GError **error
); GgitOId * ggit_index_write_tree (GgitIndex *idx
,GError **error
); gboolean ggit_index_remove (GgitIndex *idx
,GFile *file
,gint stage
,GError **error
); gboolean ggit_index_add (GgitIndex *idx
,GgitIndexEntry *entry
,GError **error
); gboolean ggit_index_add_file (GgitIndex *idx
,GFile *file
,GError **error
); gboolean ggit_index_add_path (GgitIndex *idx
,const gchar *path
,GError **error
); GgitRepository * ggit_index_get_owner (GgitIndex *idx
); GgitIndexEntries * ggit_index_get_entries (GgitIndex *idx
); GgitIndexEntriesResolveUndo * ggit_index_get_entries_resolve_undo (GgitIndex *idx
);
GgitIndex * ggit_index_open (GFile *file
,GError **error
);
Create a new bare Git index object as a memory representation of the Git
index file in file
, without a repository to back it.
|
a GFile. |
|
a GError for error reporting, or NULL . |
Returns : |
a GgitIndex or NULL if an error occurred. [transfer full]
|
gboolean ggit_index_read (GgitIndex *idx
,GError **error
);
Update the contents of an existing index object in memory by reading from the hard disk.
|
a GgitIndex. |
|
a GError for error reporting, or NULL . |
Returns : |
TRUE if the index could be read from the file associated with the
index, FALSE otherwise. |
gboolean ggit_index_write (GgitIndex *idx
,GError **error
);
Write an existing index object from memory back to disk using an atomic file lock.
|
a GgitIndex. |
|
a GError for error reporting, or NULL . |
Returns : |
TRUE if the index was successfully written to disk, FALSE otherwise. |
GgitOId * ggit_index_write_tree (GgitIndex *idx
,GError **error
);
Write a new tree object to disk containing a representation of the current state of the index. The index must be associated to an existing repository and must not contain any files in conflict. You can use the resulting tree to for instance create a commit.
gboolean ggit_index_remove (GgitIndex *idx
,GFile *file
,gint stage
,GError **error
);
Remove a file from the index (specified by position).
|
a GgitIndex. |
|
the file to search. |
|
the stage to search. |
|
a GError for error reporting, or NULL . |
Returns : |
TRUE if the file was successfully removed, FALSE otherwise. |
gboolean ggit_index_add (GgitIndex *idx
,GgitIndexEntry *entry
,GError **error
);
Add a file to the index.
|
a GgitIndex. |
|
a GgitIndexEntry. |
|
a GError for error reporting, or NULL . |
Returns : |
TRUE if the file was successfully added, FALSE otherwise. |
gboolean ggit_index_add_file (GgitIndex *idx
,GFile *file
,GError **error
);
Add a file to the index. The specified file must be in the working directory and must exist and be readable.
|
a GgitIndex. |
|
file to add. |
|
a GError for error reporting, or NULL . |
Returns : |
TRUE if the file was added to the index or FALSE if there was an error. |
gboolean ggit_index_add_path (GgitIndex *idx
,const gchar *path
,GError **error
);
Add a file to the index by path. You can specify both relative paths (to the working directory) and absolute paths. Absolute paths however must reside in the working directory. The specified path must exist and must be readable.
|
a GgitIndex. |
|
path to the file to add. |
|
a GError for error reporting, or NULL . |
Returns : |
TRUE if the file was added to the index or FALSE if there was an error. |
GgitRepository * ggit_index_get_owner (GgitIndex *idx
);
Get the GgitRepository that owns the index.
|
a GgitIndex. |
Returns : |
the GgitRepository that owns this index. [transfer full] |
GgitIndexEntries * ggit_index_get_entries (GgitIndex *idx
);
Get the index entries enumerator.
|
a GgitIndex. |
Returns : |
a GgitIndexEntries. [transfer full] |
GgitIndexEntriesResolveUndo * ggit_index_get_entries_resolve_undo
(GgitIndex *idx
);
Get the resolve undo entries enumerator.
|
a GgitIndex. |
Returns : |
a GgitIndexEntriesResolveUndo. [transfer full] |