package
0.0.0-20220328024126-2ee2aa9d18c6
Repository: https://github.com/nivl/git-go.git
Documentation: pkg.go.dev
# Functions
ConfigPath returns the path to the local config file.
DescriptionFilePath returns the path to the description file.
DotGitPath returns the path to the dotgit directory.
IsRefNameValid returns whether the name of a reference is valid or not https://stackoverflow.com/a/12093994/382879.
LocalBranchesPath returns the path to the directory containing the local branches.
LocalBranchFullName returns the full name of branch ex.
LocalBranchShortName returns the short name of a branch ex.
LocalTagFullName returns the full name of a tag ex.
LocalTagShortName returns the short name of a tag ex.
LooseObjectPath returns the path of a loose object.
NewOidFromChars creates an Oid from the given char bytes For the SHA {'9', 'b', '9', '1', 'd', 'a', ...} the oid will be {0x9b, 0x91, 0xda, ...}.
NewOidFromContent returns the Oid of the given content.
NewOidFromHex returns an Oid from the provided byte-encoded oid This basically cast a slice that contains an encoded oid into a Oid object.
NewOidFromStr creates an Oid from the given string For the SHA 9b91da06e69613397b38e0808e0ba5ee6983251b the oid will be {0x9b, 0x91, 0xda, ...}.
NewReference return a new Reference object that targets an object.
NewSymbolicReference return a new Reference object that targets another reference.
ObjectsInfoPath returns the path to the directory that contains the info about the objects.
ObjectsPacksPath returns the path to the directory that contains the packfiles.
ObjectsPath returns the path to the directory that contains the object.
PackedRefsPath return the local path of a the packed-refs file.
PackfilePath returns the path of a packfiles.
RefFullName returns the UNIX path of a ref.
RefPath return the path of a reference.
RefsPath return the path to the directory that contains all the refs.
ResolveReference resolves symbolic references.
TagsPath returns the path to the directory that contains the tags.
# Constants
CherryPickHead is a reference to the commit that is being cherry-picked.
Head is a reference to the current branch, or to a commit if we're detached.
Master correspond to the default branch name if none was specified.
MergeHead is a reference to the commit that is being merged into the current branch.
OidReference represents a reference that targets an Oid.
OidSize is the length of an oid, in bytes.
OrigHead is a backup reference of HEAD set during destructive commands such as rebase, merge, etc.
SymbolicReference represents a reference that targets another reference.
# Variables
ErrInvalidOid is returned when a given value isn't a valid Oid.
ErrObjectNotFound is an error corresponding to a git object not being found.
ErrPackedRefInvalid is an error thrown when the packed-refs file cannot be parsed properly.
ErrRefExists is an error thrown when trying to act on a reference that should not exist, but does.
ErrRefInvalid is an error thrown when a reference is not valid.
ErrRefNameInvalid is an error thrown when the name of a reference is not valid.
ErrRefNotFound is an error thrown when trying to act on a reference that doesn't exists.
ErrUnknownRefType is an error thrown when the type of a reference is unknown.
NullOid is the value of an empty Oid, or one that's all 0s.
# Structs
Reference represents a git reference https://git-scm.com/book/en/v2/Git-Internals-Git-References.
# Type aliases
Oid represents an object id.
RefContent represents a method that returns the content of reference This is used so we can do the process here, without depending on a specific backend or having circular dependencies.
ReferenceType represents the type of a reference.