Class Commands
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
LocalPathPath 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
PackIndexPack index for faster pack access.
rootTreeHash
Sha1HashHash of the root tree that should be processed.
gitDirectory
LocalPathPath to repository's
./git
directory.filePath
stringPath to the file that needs to be processed.
blobHash
Sha1HashHash 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
LocalPathPath to the pack file.
verbose
boolVerbosity 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
LocalPathPath to the
.git
directory.streams
Commands.TreeStreamsA collection of tree objects.