Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.
mattt edited this page Jul 27, 2020 · 4 revisions

Index

A repository index.

public final class Index

Initializers

init(_:)

init(_ pointer: OpaquePointer)

Properties

pointer

var pointer: OpaquePointer!

managed

var managed: Bool

owner

The repository for the index.

var owner: Repository

path

The file path to the repository index file.

var path: String!

version

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.

entries

Returns a sequence of entries in the index.

var entries: AnySequence<Entry>

Methods

reload(force:)

Update the contents of an existing index object in memory by reading from disk.

public func reload(force: Bool) throws

Important: If there are changes on disk, unwritten in-memory changes are discarded.

Parameters

  • force: - 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.

Clone this wiki locally