Namespace Fenrir.Git
This namespace contains all the tools to work with a Git repository. The main entry points for the user are:
- Refs for working with Git references,
- Commits for working with Git commits,
- Trees for working with Git trees (lists of files in a commit),
- Objects for working with raw Git objects (including the committed file contents),
- Commands for various high-level commands.
For most of the commit enumeration functions, you'll be required to construct a PackIndex object first, passing it a path to the repository. Its reuse is important for optimization, in case when you want to access several pieces of information in one repository.
If you are looking to work with a Git commit tree, then start by calling Refs.ReadRefs, and then call Commits.ReadCommit in loop for the Ref.CommitObjectId and CommitBody.Parents.
If you are looking to traverse a file tree object (obtained from CommitBody.Tree property), then call Trees.ReadTreeBody on the tree objects and check the types of the returned objects via Objects.ReadHeader: if their Type is GitBlob, then they are files, otherwise they are subtrees and should be recursively processed.
Classes
- Commands
Various high-level commands to operate on a Git repository.
- Commands.TreeStreams
A collection of streams containing objects in a tree.
- Commits
Functions to manipulate Git commits.
- PackIndex
Type to store, cache and access information about Git pack files.
This type is thread-safe.
- Packing
Functions to operate on pack files.
- Packing.PackedObject
An unpacked form of an object in a pack file.
- Refs
Functions to operate on Git references.
- Trees
Functions to work with Git tree objects.
- Zlib
Functions to work with Deflate compression.
Structs
- Sha1Hash
Structure representing an SHA-1 hash. Guarantees the stored hash is valid, will normalize it to lowercase when converted to a string.
Enums
- Packing.PackedObjectType
Read more in the pack format documentation.