get_by_path


Description:

public IndexEntry? get_by_path (File file, int stage)

Get a IndexEntry by index.

Note that the returned IndexEntry is _only_ valid as long as:

1) The associated index has not been closed 2) The entry has not been removed (see remove) 3) The index has not been refreshed (see read)

Changes to the IndexEntry will be reflected in the index once written back to disk using 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.

Parameters:

this

a IndexEntries.

file

the path to search.

stage

stage to search.

Returns:

a IndexEntry or null if it was not found.