Ggit.IndexEntries

Fields

None

Methods

get_by_index (idx)

get_by_path (file, stage)

ref ()

size ()

unref ()

Details

class Ggit.IndexEntries

Represents the entries in an index object.

get_by_index(idx)
Parameters:

idx (int) – the index of the entry.

Returns:

a Ggit.IndexEntry or None if out of bounds.

Return type:

Ggit.IndexEntry or None

Get a Ggit.IndexEntry by index. Note that the returned Ggit.IndexEntry is _only_ valid as long as:

  1. The associated index has been closed

  2. The entry has not been removed (see Ggit.Index.remove())

  3. The index has not been refreshed (see Ggit.Index.read())

Changes to the Ggit.IndexEntry will be reflected in the index once written back to disk using Ggit.Index.write().

get_by_path(file, stage)
Parameters:
  • file (Gio.File) – the path to search.

  • stage (int) – stage to search.

Returns:

a Ggit.IndexEntry or None if it was not found.

Return type:

Ggit.IndexEntry or None

Get a Ggit.IndexEntry by index. Note that the returned Ggit.IndexEntry is _only_ valid as long as:

  1. The associated index has not been closed

  2. The entry has not been removed (see Ggit.Index.remove())

  3. The index has not been refreshed (see Ggit.Index.read())

Changes to the Ggit.IndexEntry will be reflected in the index once written back to disk using Ggit.Index.write().

stage indicates the stage to search the file for. Stages are used in the index when merge conflicts occur, such that multiple versions of the same file can be represented in the index. Stage 0 is associated with the working tree, while stages 1 to 3 are associated with the various versions of the file in a merge conflict. The special value -1 can be used to match the first file encountered in any stage.

ref()
Returns:

a Ggit.IndexEntries or None.

Return type:

Ggit.IndexEntries or None

Atomically increments the reference count of self by one. This function is MT-safe and may be called from any thread.

size()
Returns:

the number of entries.

Return type:

int

Get the number of Ggit.IndexEntry entries.

unref()

Atomically decrements the reference count of self by one. If the reference count drops to 0, self is freed.