Class Refs
Functions to operate on Git references.
[CompilationMapping(SourceConstructFlags.Module)]
public static class Refs
- Inheritance
-
Refs
- Inherited Members
Methods
IsHeadDetached(LocalPath)
Determines if the repository is in the detached head state.
public static bool IsHeadDetached(LocalPath gitDirectory)
Parameters
gitDirectoryLocalPathPath to the
.gitdirectory.
Returns
ReadHead(LocalPath)
Reads a reference from the HEAD file in the repository.
public static Task<Ref?> ReadHead(LocalPath gitDirectory)
Parameters
gitDirectoryLocalPathPath to the repository's
.gitdirectory.
Returns
ReadRefs(LocalPath)
Reads the list of references available in a repository.
public static IEnumerable<Ref> ReadRefs(LocalPath repositoryPath)
Parameters
repositoryPathLocalPathPath to a repository's
.gitdirectory.
Returns
Remarks
This function supports both packed and unpacked refs.
UpdateAllRefs(Sha1Hash, Sha1Hash, LocalPath)
Update all refs pointing to the specified commit to point to the new commit.
public static void UpdateAllRefs(Sha1Hash oldCommit, Sha1Hash newCommit, LocalPath gitDirectory)
Parameters
oldCommitSha1HashOld commit to update from.
newCommitSha1HashNew commit to update to.
gitDirectoryLocalPathPath to the
.gitdirectory.
UpdateHead(Sha1Hash, Sha1Hash, LocalPath)
Update the HEADall reference to point to the new commit if it points to the old commit.
public static void UpdateHead(Sha1Hash oldCommit, Sha1Hash newCommit, LocalPath gitDirectory)