Repository_Index - SwiftDocOrg/Git GitHub Wiki
A repository index.
public final class Index
RandomAccessCollection
public typealias Element = Entry
The index on-disk version.
var version: Int
Valid return values are 2, 3, or 4. If 3 is returned, an index with version 2 may be written instead, if the extension data in version 3 is not necessary.
The repository for the index.
var owner: Repository
The file path to the repository index file.
var path: String!
Returns a sequence of entries in the index.
var entries: AnySequence<Entry>
var startIndex: Int
var endIndex: Int
Update the contents of an existing index object in memory by reading from disk.
public func reload(force: Bool) throws
- force: If true, this performs a "hard" read that discards in-memory changes and always reloads the on-disk index data. If there is no on-disk version, the index will be cleared. If false, this does a "soft" read that reloads the index data from disk only if it has changed since the last time it was loaded. Purely in-memory index data will be untouched.
public func add(path: String, force: Bool = false) throws
public func add(paths: [String], update: Bool = false, force: Bool = false, disableGlobExpansion: Bool = false) throws