Repository

class Repository(initialBranch: String = "master")

Constructors

Link copied to clipboard
constructor(initialBranch: String = "master")

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun commit(commit: Commit): Commit

(Deep) get or put a commit object into the repository. This will also get or put all child trees and blobs.

Link copied to clipboard
fun createBranch(name: String, use: Boolean = true)

Create a new branch as a copy of the current branch.

Link copied to clipboard

Dump repository objects

Link copied to clipboard
fun findCommit(predicate: (Commit) -> Boolean): Commit?

Find commit.

Link copied to clipboard
fun getCommit(hash: String): Commit?

Get a commit by its hash.

Link copied to clipboard

List all commits.

Link copied to clipboard
fun useBranch(name: String)

Use (switch to) a branch.