Table of Contents

Class Commands

Namespace
Fenrir.Git
Assembly
Fenrir.Git.dll

Various high-level commands to operate on a Git repository.

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

Methods

InitializeRepository(LocalPath)

Initialize an empty Git repository. A .git subdirectory will be created.

public static void InitializeRepository(LocalPath repositoryPath)

Parameters

repositoryPath LocalPath

Path to the repository folder.

UpdateObjectInTree(PackIndex, Sha1Hash, LocalPath, string, Sha1Hash)

Update a particular object in a tree, while traversing nested trees.

public static Task<Commands.TreeStreams> UpdateObjectInTree(PackIndex packIndex, Sha1Hash rootTreeHash, LocalPath gitDirectory, string filePath, Sha1Hash blobHash)

Parameters

packIndex PackIndex

Pack index for faster pack access.

rootTreeHash Sha1Hash

Hash of the root tree that should be processed.

gitDirectory LocalPath

Path to repository's ./git directory.

filePath string

Path to the file that needs to be processed.

blobHash Sha1Hash

Hash of the object that should replace the file by filePath.

Returns

Task<Commands.TreeStreams>

A collection of streams with all the modified trees.

VerifyPackFile(LocalPath, bool)

Verify a pack file.

public static IEnumerable<string> VerifyPackFile(LocalPath packFile, bool verbose)

Parameters

packFile LocalPath

Path to the pack file.

verbose bool

Verbosity flag.

Returns

IEnumerable<string>

Pack file verification report.

WriteTreeObjects(LocalPath, TreeStreams)

Saves a collection of tree objects to the repository.

public static void WriteTreeObjects(LocalPath gitDirectory, Commands.TreeStreams streams)

Parameters

gitDirectory LocalPath

Path to the .git directory.

streams Commands.TreeStreams

A collection of tree objects.