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
repositoryPathLocalPathPath 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
packIndexPackIndexPack index for faster pack access.
rootTreeHashSha1HashHash of the root tree that should be processed.
gitDirectoryLocalPathPath to repository's
./gitdirectory.filePathstringPath to the file that needs to be processed.
blobHashSha1HashHash 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
packFileLocalPathPath to the pack file.
verboseboolVerbosity 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
gitDirectoryLocalPathPath to the
.gitdirectory.streamsCommands.TreeStreamsA collection of tree objects.