class documentation

Represents an entry in the Git index.

This is a higher-level representation of an index entry that includes parsed data and convenience methods.

Class Method from_serialized Create an IndexEntry from a SerializedIndexEntry.
Method is_sparse_dir Check if this entry represents a sparse directory.
Method serialize Serialize this entry with a given name and stage.
Method set_skip_worktree Helper method to set or clear the skip-worktree bit in extended_flags.
Method stage Get the merge conflict stage of this entry.
Class Variable ctime Undocumented
Class Variable dev Undocumented
Class Variable extended_flags Undocumented
Class Variable flags Undocumented
Class Variable gid Undocumented
Class Variable ino Undocumented
Class Variable mode Undocumented
Class Variable mtime Undocumented
Class Variable sha Undocumented
Class Variable size Undocumented
Class Variable uid Undocumented
Property skip_worktree Return True if the skip-worktree bit is set in extended_flags.
def from_serialized(cls, serialized: SerializedIndexEntry) -> IndexEntry:

Create an IndexEntry from a SerializedIndexEntry.

Parameters
serialized:SerializedIndexEntrySerializedIndexEntry to convert
Returns
IndexEntryNew IndexEntry instance
def is_sparse_dir(self, name: bytes) -> bool:

Check if this entry represents a sparse directory.

A sparse directory entry is a collapsed representation of an entire directory tree in a sparse index. It has: - Directory mode (0o040000) - SKIP_WORKTREE flag set - Path ending with '/' - SHA pointing to a tree object

Parameters
name:bytesThe path name for this entry (IndexEntry doesn't store name)
Returns
boolTrue if entry is a sparse directory entry
def serialize(self, name: bytes, stage: Stage) -> SerializedIndexEntry:

Serialize this entry with a given name and stage.

Parameters
name:bytesPath name for the entry
stage:StageMerge conflict stage
Returns
SerializedIndexEntrySerializedIndexEntry ready for writing to disk
def set_skip_worktree(self, skip: bool = True):

Helper method to set or clear the skip-worktree bit in extended_flags.

Also sets FLAG_EXTENDED in self.flags if needed.

def stage(self) -> Stage:

Get the merge conflict stage of this entry.

Returns
StageStage enum value
ctime: int | float | tuple[int, int] =

Undocumented

dev: int =

Undocumented

extended_flags: int =

Undocumented

flags: int =

Undocumented

gid: int =

Undocumented

ino: int =

Undocumented

mode: int =

Undocumented

mtime: int | float | tuple[int, int] =

Undocumented

sha: ObjectID =

Undocumented

size: int =

Undocumented

uid: int =

Undocumented

skip_worktree: bool =

Return True if the skip-worktree bit is set in extended_flags.