-
Notifications
You must be signed in to change notification settings - Fork 6
Repository
public final class Repository
init(_ pointer: OpaquePointer)
public init(_ url: URL) throws
var pointer: OpaquePointer!
var managed: Bool
The repository's working directory.
var commonDirectory: URL?
For example, path/to/repository/.git
.
The repository's working directory,
or nil
if the repository is bare.
var workingDirectory: URL?
For example, path/to/repository
.
The repository index, if any.
var index: Index?
The HEAD
of the repository.
var head: Head?
public class func create(at url: URL, bare: Bool = false) throws -> Repository
Returns a branch by name.
public func branch(named name: String) throws -> Branch?
Lookup an object by ID.
public func lookup<T: Object>(_ id: Object.ID) throws -> T?
- id: - id: The object ID.
An error if no object exists for the
The corresponding object.
Returns the revision matching the provided specification.
public func revision(matching specification: String) throws -> (Commit?, Reference?)
- specification: - specification: A revision specification.
A tuple containing the commit and/or reference matching the specification.
Calculates the number of unique revisions between two commits.
public func distance(from local: Commit, to upstream: Commit) throws -> (ahead: Int, behind: Int)
- local: - local: The local commit.
- upstream: - upstream: The upstream commit.
A tuple with the number of commits ahead
and behind
.
Returns a sequence of revisions according to the specified configuration.
public func revisions(with configuration: (RevisionWalker) throws -> Void) throws -> AnySequence<Commit>
- configuration: - configuration: A closure whose argument can be modified to change which revisions are returned by the sequence, and the order in which they appear.
Any error that occured during configuration.
A sequence of revisions.
Generated at 2020-09-02T17:06:43+0000 using swift-doc 1.0.0-beta.4.
Types
- Blob
- Branch
- Commit
- Credentials
- Error
- Message
- Note
- Object
- Object.ID
- Reference
- Reference.Format
- Remote
- Remote.Fetch
- Remote.Fetch.Configuration
- Remote.Fetch.TagFollowing
- Repository
- Repository.Attributes
- Repository.Attributes.Value
- Repository.Checkout
- Repository.Checkout.Configuration
- Repository.Checkout.ConflictResolution
- Repository.Checkout.Strategy
- Repository.Clone
- Repository.Clone.Configuration
- Repository.Clone.Local
- Repository.Head
- Repository.Index
- Repository.Index.Entry
- Repository.Index.Stage
- RevisionSortingOptions
- Signature
- Tag
- Tag.Annotation
- Tree
- Tree.Entry