class documentation

class Index(object):

View In Hierarchy

A Git Index file.

Method __delitem__ Undocumented
Method __getitem__ Retrieve entry by relative path.
Method __init__ Create an index object associated with the given filename.
Method __iter__ Iterate over the paths in this index.
Method __len__ Number of entries in this index file.
Method __repr__ Undocumented
Method __setitem__ Undocumented
Method changes_from_tree Find the differences between the contents of this index and a tree.
Method clear Remove all contents from this index.
Method commit Create a new tree from an index.
Method get_mode Return the POSIX file mode for the object at a path.
Method get_sha1 Return the (git object) SHA1 for the object at a path.
Method items Undocumented
Method iteritems Undocumented
Method iterobjects Iterate over path, sha, mode tuples for use with commit_tree.
Method read Read current contents of index from disk.
Method update Undocumented
Method write Write current contents of index to disk.
Property path Undocumented
Instance Variable _byname Undocumented
Instance Variable _filename Undocumented
Instance Variable _version Undocumented
def __delitem__(self, name):

Undocumented

Parameters
name:bytesUndocumented
def __getitem__(self, name):

Retrieve entry by relative path.

Returns: tuple with (ctime, mtime, dev, ino, mode, uid, gid, size, sha,
flags)
Parameters
name:bytesUndocumented
Returns
IndexEntryUndocumented
def __init__(self, filename, read=True):

Create an index object associated with the given filename.

Parameters
filename:Union[bytes, str]Path to the index file
readWhether to initialize the index from the given file, should it exist.
def __iter__(self):

Iterate over the paths in this index.

Returns
Iterator[bytes]Undocumented
def __len__(self):

Number of entries in this index file.

Returns
intUndocumented
def __repr__(self):

Undocumented

def __setitem__(self, name, x):

Undocumented

Parameters
name:bytesUndocumented
x:IndexEntryUndocumented
def changes_from_tree(self, object_store, tree, want_unchanged=False):

Find the differences between the contents of this index and a tree.

Returns: Iterator over tuples with (oldpath, newpath), (oldmode,
newmode), (oldsha, newsha)
Parameters
object_storeObject store to use for retrieving tree contents
tree:ObjectIDSHA1 of the root tree
want_unchanged:boolWhether unchanged files should be reported
def clear(self):

Remove all contents from this index.

def commit(self, object_store):

Create a new tree from an index.

Parameters
object_storeObject store to save the tree in
Returns
Root tree SHA
def get_mode(self, path):

Return the POSIX file mode for the object at a path.

Parameters
path:bytesUndocumented
Returns
intUndocumented
def get_sha1(self, path):

Return the (git object) SHA1 for the object at a path.

Parameters
path:bytesUndocumented
Returns
bytesUndocumented
def items(self):

Undocumented

Returns
Iterator[Tuple[bytes, IndexEntry]]Undocumented
def iteritems(self):

Undocumented

Returns
Iterator[Tuple[bytes, IndexEntry]]Undocumented
def iterobjects(self):

Iterate over path, sha, mode tuples for use with commit_tree.

Returns
Iterable[Tuple[bytes, bytes, int]]Undocumented
def read(self):

Read current contents of index from disk.

def update(self, entries):

Undocumented

Parameters
entries:Dict[bytes, IndexEntry]Undocumented
def write(self):

Write current contents of index to disk.

@property
path =

Undocumented

_byname: dict =

Undocumented

_filename =

Undocumented

_version =

Undocumented