Index class

Mixed-in types

Constructors

Index.newInMemory()
Creates an in-memory index object.

Properties

capabilities Set<GitIndexCapability>
Index capabilities flags.
getter/setter pair
conflicts Map<String, ConflictEntry>
Returns map of conflicts in the index with key as conflicted file path and value as ConflictEntry object.
no setter
first IndexEntry
The first element.
no setterinherited
hasConflicts bool
Whether index contains entries representing file conflicts.
no setter
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Whether this collection has no elements.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator Iterator<IndexEntry>
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last IndexEntry
The last element.
no setterinherited
length int
The number of elements in this Iterable.
no setterinherited
path String?
Full path to the index file on disk.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single IndexEntry
Checks that this iterable has only one element, and returns that element.
no setterinherited

Methods

add(Object entry) → void
Adds or updates an index entry from an IndexEntry or from a file on disk.
addAll(List<String> pathspec, {Set<GitIndexAddOption> flags = const {GitIndexAddOption.defaults}}) → void
Adds or updates index entries matching files in the working directory.
addConflict({IndexEntry? ancestorEntry, IndexEntry? ourEntry, IndexEntry? theirEntry}) → void
Adds or updates index entries to represent a conflict. Any staged entries that exist at the given paths will be removed.
addFromBuffer({required IndexEntry entry, required String buffer}) → void
Adds or updates an index entry from a buffer in memory.
any(bool test(IndexEntry element)) bool
Checks whether any element of this iterable satisfies test.
inherited
cast<R>() Iterable<R>
A view of this iterable as an iterable of R instances.
inherited
cleanupConflict() → void
Removes all conflicts in the index (entries with a stage greater than 0).
clear() → void
Clears the contents (all the entries) of an index object.
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
elementAt(int index) IndexEntry
Returns the indexth element.
inherited
every(bool test(IndexEntry element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> toElements(IndexEntry element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
find(String path) bool
Whether entry at provided path is in the git index or not.
firstWhere(bool test(IndexEntry element), {IndexEntry orElse()?}) IndexEntry
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, IndexEntry element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<IndexEntry> other) Iterable<IndexEntry>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void action(IndexEntry element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
free() → void
Releases memory allocated for index object.
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(IndexEntry element), {IndexEntry orElse()?}) IndexEntry
The last element that satisfies the given predicate test.
inherited
map<T>(T toElement(IndexEntry e)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read({bool force = true}) → void
Updates the contents of an existing index object in memory by reading from the hard disk.
readTree(Tree tree) → void
Updates the contents of an existing index object in memory by reading from the specified tree.
reduce(IndexEntry combine(IndexEntry value, IndexEntry element)) IndexEntry
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
remove(String path, [int stage = 0]) → void
Removes an entry from the index at provided path relative to repository working directory with optional stage.
removeAll(List<String> path) → void
Removes all matching index entries at provided list of paths relative to repository working directory.
removeDirectory(String directory, [int stage = 0]) → void
Removes all entries from the index under a given directory with optional stage.
singleWhere(bool test(IndexEntry element), {IndexEntry orElse()?}) IndexEntry
The single element that satisfies test.
inherited
skip(int count) Iterable<IndexEntry>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(IndexEntry value)) Iterable<IndexEntry>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
take(int count) Iterable<IndexEntry>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(IndexEntry value)) Iterable<IndexEntry>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toList({bool growable = true}) List<IndexEntry>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<IndexEntry>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
A string representation of this object.
override
updateAll(List<String> pathspec) → void
Updates all index entries to match the working directory.
where(bool test(IndexEntry element)) Iterable<IndexEntry>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
inherited
write() → void
Writes an existing index object from memory back to disk using an atomic file lock.
writeTree([Repository? repo]) Oid
Writes the index as a tree.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Object value) IndexEntry
Returns index entry located at provided 0-based position or string path.