Top |
Functions
GgitIndex * | ggit_index_open () |
gboolean | ggit_index_read () |
gboolean | ggit_index_write () |
GgitOId * | ggit_index_write_tree () |
gboolean | ggit_index_remove () |
gboolean | ggit_index_add () |
gboolean | ggit_index_add_file () |
gboolean | ggit_index_add_path () |
GgitRepository * | ggit_index_get_owner () |
GgitIndexEntries * | ggit_index_get_entries () |
GgitIndexEntriesResolveUndo * | ggit_index_get_entries_resolve_undo () |
Functions
ggit_index_open ()
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.
ggit_index_read ()
gboolean ggit_index_read (GgitIndex *idx
,gboolean force
,GError **error
);
Update the contents of an existing index object in memory by reading from the hard disk.
If force
is true, this performs a "hard" read that discards in-memory
changes and always reloads the on-disk index data. If there is no on-disk
version, the index will be cleared.
If force
is false, this does a "soft" read that reloads the index data from
disk only if it has changed since the last time it was loaded. Purely
in-memory index data will be untouched. Be aware: if there are changes on
disk, unwritten in-memory changes are discarded.
Parameters
idx |
a GgitIndex. |
|
force |
force read even if there are in-memory changes. |
|
error |
a GError for error reporting, or |
ggit_index_write ()
gboolean ggit_index_write (GgitIndex *idx
,GError **error
);
Write an existing index object from memory back to disk using an atomic file lock.
ggit_index_write_tree ()
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.
ggit_index_remove ()
gboolean ggit_index_remove (GgitIndex *idx
,GFile *file
,gint stage
,GError **error
);
Remove a file from the index (specified by position).
Parameters
idx |
a GgitIndex. |
|
file |
the file to search. |
|
stage |
the stage to search. |
|
error |
a GError for error reporting, or |
ggit_index_add ()
gboolean ggit_index_add (GgitIndex *idx
,GgitIndexEntry *entry
,GError **error
);
Add a file to the index.
ggit_index_add_file ()
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.
ggit_index_add_path ()
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.
Parameters
idx |
a GgitIndex. |
|
path |
path to the file to add. |
|
error |
a GError for error reporting, or |
ggit_index_get_owner ()
GgitRepository *
ggit_index_get_owner (GgitIndex *idx
);
Get the GgitRepository that owns the index.
ggit_index_get_entries ()
GgitIndexEntries *
ggit_index_get_entries (GgitIndex *idx
);
Get the index entries enumerator.
ggit_index_get_entries_resolve_undo ()
GgitIndexEntriesResolveUndo *
ggit_index_get_entries_resolve_undo (GgitIndex *idx
);
Get the resolve undo entries enumerator.