Table of Contents

Class Commits

Namespace
Fenrir.Git
Assembly
Fenrir.Git.dll

Functions to manipulate Git commits.

[CompilationMapping(SourceConstructFlags.Module)]
public static class Commits
Inheritance
Commits
Inherited Members

Methods

ReadCommit(PackIndex, LocalPath, Sha1Hash)

Reads a commit with specified hash.

public static Task<Commit> ReadCommit(PackIndex index, LocalPath gitDirectory, Sha1Hash hash)

Parameters

index PackIndex

Pack file index of the repository.

gitDirectory LocalPath

Path to the .git directory.

hash Sha1Hash

Commit hash.

Returns

Task<Commit>

ReadCommitBody(Stream)

Reads the commit body from a stream.

public static CommitBody ReadCommitBody(Stream decodedInput)

Parameters

decodedInput Stream

Returns

CommitBody

TraverseCommits(LocalPath, Sha1Hash)

Starting with commit headCommitHash, will enumerate all its parents. The enumeration order between commits not related via parent-child relationship is unspecified, but any commit is guaranteed to be returned before any of its parents.

public static IAsyncEnumerable<Commit> TraverseCommits(LocalPath gitDirectory, Sha1Hash headCommitHash)

Parameters

gitDirectory LocalPath

Path to the .git directory.

headCommitHash Sha1Hash

Hash of the starting commit.

Returns

IAsyncEnumerable<Commit>

WriteCommitBody(CommitBody, Stream)

Writes the commit body's internal representation as a Git object to a passed stream.

public static void WriteCommitBody(CommitBody commit, Stream stream)

Parameters

commit CommitBody
stream Stream