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 · 5 revisions

Commit

A commit object.

public final class Commit: Object

Inheritance

Object

Properties

type

var type: git_object_t

tree

The tree containing the commit, if any.

var tree: Tree?

parents

The parents of the commit.

var parents: [Commit]

message

The commit message, if any.

var message: String?

author

The signature of the author.

var author: Signature

committer

The signature of the committer.

var committer: Signature

Methods

distance(to:)

Calculates the number of unique revisions to another commit.

public func distance(to upstream: Commit) throws -> (ahead: Int, behind: Int)

Parameters

  • upstream: - upstream: The upstream commit.

Returns

A tuple with the number of commits ahead and behind.

isDescendent(of:)

Determines whether the commit is a descendent of another commit.

public func isDescendent(of ancestor: Commit) throws -> Bool

Parameters

  • ancestor: - ancestor: The presumptive ancestor.

Clone this wiki locally