{"modulePath":"github.com/duplexsystem/git-lfs","version":"v2.5.2+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git\n\nPackage git contains various commands that shell out to git NOTE: Subject to change, do not rely on this package from outside git-lfs source\n\nPackage git contains various commands that shell out to git NOTE: Subject to change, do not rely on this package from outside git-lfs source\n\n## Constants\n\n```go\nconst (\n\tRefTypeLocalBranch  = RefType(iota)\n\tRefTypeRemoteBranch = RefType(iota)\n\tRefTypeLocalTag     = RefType(iota)\n\tRefTypeRemoteTag    = RefType(iota)\n\tRefTypeHEAD         = RefType(iota) // current checkout\n\tRefTypeOther        = RefType(iota) // stash or unknown\n\n\t// A ref which can be used as a placeholder for before the first commit\n\t// Equivalent to git mktree \u003c /dev/null, useful for diffing before first commit\n\tRefBeforeFirstCommit = \"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"\n)\n```\n\n```go\nconst (\n\tLockableAttrib = \"lockable\"\n)\n```\n\n```go\nconst (\n\t// MaxPacketLength is the maximum total (header+payload) length\n\t// encode-able within one packet using Git's pkt-line protocol.\n\tMaxPacketLength = 65516\n)\n```\n\n## Functions\n\n```go\nfunc CatFile() (*subprocess.BufferedCmd, error)\n```\n\n```go\nfunc Checkout(treeish string, paths []string, force bool) error\n```\nCheckout performs an invocation of \\`git-checkout(1)\\` applying the given treeish, paths, and force option, if given.\n\nIf any error was encountered, it will be returned immediately. Otherwise, the checkout has occurred successfully.\n\n```go\nfunc CloneWithoutFilters(flags CloneFlags, args []string) error\n```\nCloneWithoutFilters clones a git repo but without the smudge filter enabled so that files in the working copy will be pointers and not real LFS data\n\n```go\nfunc DiffIndex(ref string, cached bool) (*bufio.Scanner, error)\n```\n\n```go\nfunc Fetch(remotes ...string) error\n```\nFetch performs a fetch with no arguments against the given remotes.\n\n```go\nfunc FormatGitDate(tm time.Time) string\n```\nFormatGitDate converts a Go date into a git command line format date\n\n```go\nfunc GetAttributeFilter(workingDir, gitDir string) *filepathfilter.Filter\n```\nGetAttributeFilter returns a list of entries in .gitattributes which are configured with the filter=lfs attribute as a file path filter which file paths can be matched against workingDir is the root of the working copy gitDir is the root of the git repo\n\n```go\nfunc GetFilesChanged(from, to string) ([]string, error)\n```\nGetFilesChanged returns a list of files which were changed, either between 2 commits, or at a single commit if you only supply one argument and a blank string for the other\n\n```go\nfunc GetTrackedFiles(pattern string) ([]string, error)\n```\nGetTrackedFiles returns a list of files which are tracked in Git which match the pattern specified (standard wildcard form) Both pattern and the results are relative to the current working directory, not the root of the repository\n\n```go\nfunc GitAndRootDirs() (string, string, error)\n```\n\n```go\nfunc GitDir() (string, error)\n```\n\n```go\nfunc HashObject(r io.Reader) (string, error)\n```\n\n```go\nfunc IsBare() (bool, error)\n```\nIsBare returns whether or not a repository is bare. It requires that the current working directory is a repository.\n\nIf there was an error determining whether or not the repository is bare, it will be returned.\n\n```go\nfunc IsFileModified(filepath string) (bool, error)\n```\nIsFileModified returns whether the filepath specified is modified according to \\`git status\\`. A file is modified if it has uncommitted changes in the working copy or the index. This includes being untracked.\n\n```go\nfunc IsGitVersionAtLeast(ver string) bool\n```\nIsVersionAtLeast returns whether the git version is the one specified or higher argument is plain version string separated by '.' e.g. \"2.3.1\" but can omit minor/patch\n\n```go\nfunc IsMissingObject(err error) bool\n```\n\n```go\nfunc IsVersionAtLeast(actualVersion, desiredVersion string) bool\n```\nIsVersionAtLeast compares 2 version strings (ok to be prefixed with 'git version', ignores)\n\n```go\nfunc IsWorkingCopyDirty() (bool, error)\n```\nIsWorkingCopyDirty returns true if and only if the working copy in which the command was executed is dirty as compared to the index.\n\nIf the status of the working copy could not be determined, an error will be returned instead.\n\n```go\nfunc Log(args ...string) (*subprocess.BufferedCmd, error)\n```\n\n```go\nfunc LsRemote(remote, remoteRef string) (string, error)\n```\n\n```go\nfunc LsTree(ref string) (*subprocess.BufferedCmd, error)\n```\n\n```go\nfunc ParseGitDate(str string) (time.Time, error)\n```\nParse a Git date formatted in ISO 8601 format (%ci/%ai)\n\n```go\nfunc RemoteList() ([]string, error)\n```\n\n```go\nfunc RootDir() (string, error)\n```\n\n```go\nfunc UpdateIndexFromStdin() *subprocess.Cmd\n```\n\n```go\nfunc UpdateRef(ref *Ref, to []byte, reason string) error\n```\nUpdateRef moves the given ref to a new sha with a given reason (and creates a reflog entry, if a \"reason\" was provided). It returns an error if any were encountered.\n\n```go\nfunc UpdateRefIn(wd string, ref *Ref, to []byte, reason string) error\n```\nUpdateRef moves the given ref to a new sha with a given reason (and creates a reflog entry, if a \"reason\" was provided). It operates within the given working directory \"wd\". It returns an error if any were encountered.\n\n```go\nfunc ValidateRemote(remote string) error\n```\nValidateRemote checks that a named remote is valid for use Mainly to check user-supplied remotes \u0026 fail more nicely\n\n```go\nfunc ValidateRemoteURL(remote string) error\n```\nValidateRemoteURL checks that a string is a valid Git remote URL\n\n```go\nfunc Version() (string, error)\n```\n\n## Types\n\n```go\ntype AttributePath struct {\n\t// Path entry in the attribute file\n\tPath string\n\t// The attribute file which was the source of this entry\n\tSource *AttributeSource\n\t// Path also has the 'lockable' attribute\n\tLockable bool\n}\n```\nAttributePath is a path entry in a gitattributes file which has the LFS filter\n\n```go\nfunc GetAttributePaths(workingDir, gitDir string) []AttributePath\n```\nGetAttributePaths returns a list of entries in .gitattributes which are configured with the filter=lfs attribute workingDir is the root of the working copy gitDir is the root of the git repo\n\n```go\nfunc GetRootAttributePaths(cfg Env) []AttributePath\n```\nGetRootAttributePaths beahves as GetRootAttributePaths, and loads information only from the global gitattributes file.\n\n```go\nfunc GetSystemAttributePaths(env Env) []AttributePath\n```\nGetSystemAttributePaths behaves as GetAttributePaths, and loads information only from the system gitattributes file, respecting the $PREFIX environment variable.\n\n```go\ntype AttributeSource struct {\n\tPath       string\n\tLineEnding string\n}\n```\n\n```go\nfunc (s *AttributeSource) String() string\n```\n\n```go\ntype CloneFlags struct {\n\t// --template \u003ctemplate_directory\u003e\n\tTemplateDirectory string\n\t// -l --local\n\tLocal bool\n\t// -s --shared\n\tShared bool\n\t// --no-hardlinks\n\tNoHardlinks bool\n\t// -q --quiet\n\tQuiet bool\n\t// -n --no-checkout\n\tNoCheckout bool\n\t// --progress\n\tProgress bool\n\t// --bare\n\tBare bool\n\t// --mirror\n\tMirror bool\n\t// -o \u003cname\u003e --origin \u003cname\u003e\n\tOrigin string\n\t// -b \u003cname\u003e --branch \u003cname\u003e\n\tBranch string\n\t// -u \u003cupload-pack\u003e --upload-pack \u003cpack\u003e\n\tUpload string\n\t// --reference \u003crepository\u003e\n\tReference string\n\t// --reference-if-able \u003crepository\u003e\n\tReferenceIfAble string\n\t// --dissociate\n\tDissociate bool\n\t// --separate-git-dir \u003cgit dir\u003e\n\tSeparateGit string\n\t// --depth \u003cdepth\u003e\n\tDepth string\n\t// --recursive\n\tRecursive bool\n\t// --recurse-submodules\n\tRecurseSubmodules bool\n\t// -c \u003cvalue\u003e --config \u003cvalue\u003e\n\tConfig string\n\t// --single-branch\n\tSingleBranch bool\n\t// --no-single-branch\n\tNoSingleBranch bool\n\t// --verbose\n\tVerbose bool\n\t// --ipv4\n\tIpv4 bool\n\t// --ipv6\n\tIpv6 bool\n\t// --shallow-since \u003cdate\u003e\n\tShallowSince string\n\t// --shallow-since \u003cdate\u003e\n\tShallowExclude string\n\t// --shallow-submodules\n\tShallowSubmodules bool\n\t// --no-shallow-submodules\n\tNoShallowSubmodules bool\n\t// jobs \u003cn\u003e\n\tJobs int64\n}\n```\nFor compatibility with git clone we must mirror all flags in CloneWithoutFilters\n\n```go\ntype CommitSummary struct {\n\tSha            string\n\tShortSha       string\n\tParents        []string\n\tCommitDate     time.Time\n\tAuthorDate     time.Time\n\tAuthorName     string\n\tAuthorEmail    string\n\tCommitterName  string\n\tCommitterEmail string\n\tSubject        string\n}\n```\nSome top level information about a commit (only first line of message)\n\n```go\nfunc GetCommitSummary(commit string) (*CommitSummary, error)\n```\nGet summary information about a commit\n\n```go\ntype Configuration struct {\n\tWorkDir string\n\tGitDir  string\n\t// contains filtered or unexported fields\n}\n```\nConfiguration can fetch or modify the current Git config and track the Git version.\n\n```go\nfunc NewConfig(workdir, gitdir string) *Configuration\n```\n\n```go\nfunc (c *Configuration) CurrentRemoteRef() (*Ref, error)\n```\n\n```go\nfunc (c *Configuration) FileSource(filename string) (*ConfigurationSource, error)\n```\n\n```go\nfunc (c *Configuration) Find(val string) string\n```\nFind returns the git config value for the key\n\n```go\nfunc (c *Configuration) FindGlobal(key string) string\n```\nFindGlobal returns the git config value global scope for the key\n\n```go\nfunc (c *Configuration) FindLocal(key string) string\n```\nFind returns the git config value for the key\n\n```go\nfunc (c *Configuration) FindSystem(key string) string\n```\nFindSystem returns the git config value in system scope for the key\n\n```go\nfunc (c *Configuration) RemoteBranchForLocalBranch(localBranch string) string\n```\nRemoteBranchForLocalBranch returns the name (only) of the remote branch that the local branch is tracking If no specific branch is configured, returns local branch name\n\n```go\nfunc (c *Configuration) RemoteForBranch(localBranch string) string\n```\nRemoteForBranch returns the remote name that a given local branch is tracking (blank if none)\n\n```go\nfunc (c *Configuration) RemoteRefNameForCurrentBranch() (string, error)\n```\nRemoteRefForCurrentBranch returns the full remote ref (refs/remotes/{remote}/{remotebranch}) that the current branch is tracking.\n\n```go\nfunc (c *Configuration) SetGlobal(key, val string) (string, error)\n```\nSetGlobal sets the git config value for the key in the global config\n\n```go\nfunc (c *Configuration) SetLocal(key, val string) (string, error)\n```\nSetLocal sets the git config value for the key in the specified config file\n\n```go\nfunc (c *Configuration) SetSystem(key, val string) (string, error)\n```\nSetSystem sets the git config value for the key in the system config\n\n```go\nfunc (c *Configuration) Source() (*ConfigurationSource, error)\n```\n\n```go\nfunc (c *Configuration) Sources(optionalFilename string) ([]*ConfigurationSource, error)\n```\n\n```go\nfunc (c *Configuration) UnsetGlobalSection(key string) (string, error)\n```\nUnsetGlobalSection removes the entire named section from the global config\n\n```go\nfunc (c *Configuration) UnsetLocalKey(key string) (string, error)\n```\nUnsetLocalKey removes the git config value for the key from the specified config file\n\n```go\nfunc (c *Configuration) UnsetLocalSection(key string) (string, error)\n```\nUnsetLocalSection removes the entire named section from the system config\n\n```go\nfunc (c *Configuration) UnsetSystemSection(key string) (string, error)\n```\nUnsetSystemSection removes the entire named section from the system config\n\n```go\ntype ConfigurationSource struct {\n\tLines        []string\n\tOnlySafeKeys bool\n}\n```\n\n```go\nfunc ParseConfigLines(lines string, onlySafeKeys bool) *ConfigurationSource\n```\n\n```go\ntype Env interface {\n\tGet(key string) (val string, ok bool)\n}\n```\ncopy of env\n\n```go\ntype FilterProcessScanner struct {\n\t// contains filtered or unexported fields\n}\n```\nFilterProcessScanner provides a scanner-like interface capable of initializing the filter process with the Git parent, and scanning for requests across the protocol.\n\nReading a request (and errors) is as follows:\n\n\ts := NewFilterProcessScanner(os.Stdin, os.Stderr)\n\tfor s.Scan() {\n\t        req := s.Request()\n\t\t       // ...\n\t}\n\n\tif err := s.Err(); err != nil {\n\t        // ...\n\t}\n\n```go\nfunc NewFilterProcessScanner(r io.Reader, w io.Writer) *FilterProcessScanner\n```\nNewFilterProcessScanner constructs a new instance of the \\`\\*FilterProcessScanner\\` type which reads packets from the \\`io.Reader\\` \"r\", and writes packets to the \\`io.Writer\\`, \"w\".\n\nBoth reader and writers SHOULD NOT be \\`\\*git.PacketReader\\` or \\`\\*git.PacketWriter\\`s, they will be transparently treated as such. In other words, it is safe (and recommended) to pass \\`os.Stdin\\` and \\`os.Stdout\\` directly.\n\n```go\nfunc (o *FilterProcessScanner) Err() error\n```\nErr returns any error encountered from the last call to Scan(). It is available only after a call to \\`Scan()\\` has completed, and is re-initialized to nil at the beginning of the subsequent \\`Scan()\\` call.\n\n```go\nfunc (o *FilterProcessScanner) Init() error\n```\nInit initializes the filter and ACKs back and forth between the Git LFS subprocess and the Git parent process that each is a git-filter-server and client respectively.\n\nIf either side wrote an invalid sequence of data, or did not meet expectations, an error will be returned. If the filter type is not supported, an error will be returned. If the pkt-line welcome message was invalid, an error will be returned.\n\nIf there was an error reading or writing any of the packets below, an error will be returned.\n\n```go\nfunc (o *FilterProcessScanner) NegotiateCapabilities() ([]string, error)\n```\nNegotiateCapabilities executes the process of negotiating capabilities between the filter client and server. If we don't support any of the capabilities given to LFS by Git, an error will be returned. If there was an error reading or writing capabilities between the two, an error will be returned.\n\n```go\nfunc (o *FilterProcessScanner) Request() *Request\n```\nRequest returns the request read from a call to Scan(). It is available only after a call to \\`Scan()\\` has completed, and is re-initialized to nil at the beginning of the subsequent \\`Scan()\\` call.\n\n```go\nfunc (o *FilterProcessScanner) Scan() bool\n```\nScan scans for the next request, or error and returns whether or not the scan was successful, indicating the presence of a valid request. If the Scan failed, there was either an error reading the next request (and the results of calling \\`Err()\\` should be inspected), or the pipe was closed and no more requests are present.\n\nClosing the pipe is Git's way to communicate that no more files will be filtered. Git expects that the LFS process exits after this event.\n\n```go\nfunc (o *FilterProcessScanner) WriteList(list []string) error\n```\nWriteList writes a list of strings to the underlying pktline data stream in pktline format.\n\n```go\nfunc (o *FilterProcessScanner) WriteStatus(status FilterProcessStatus) error\n```\n\n```go\ntype FilterProcessStatus uint8\n```\nFilterProcessStatus is a constant type representing the various valid responses for \\`status=\\` in the Git filtering process protocol.\n\n```go\nconst (\n\t// StatusSuccess is a valid response when a successful event has\n\t// occurred.\n\tStatusSuccess FilterProcessStatus = iota + 1\n\t// StatusDelay is a valid response when a delay has occurred.\n\tStatusDelay\n\t// StatusError is a valid response when an error has occurred.\n\tStatusError\n)\n```\n\n```go\nfunc (s FilterProcessStatus) String() string\n```\nString implements fmt.Stringer by returning a protocol-compliant representation of the receiving status, or panic()-ing if the Status is unknown.\n\n```go\ntype ObjectScanner struct {\n\t// contains filtered or unexported fields\n}\n```\nObjectScanner is a scanner type that scans for Git objects reference-able in Git's object database by their unique OID.\n\n```go\nfunc NewObjectScanner() (*ObjectScanner, error)\n```\nNewObjectScanner constructs a new instance of the \\`\\*ObjectScanner\\` type and returns it. It backs the ObjectScanner with an invocation of the \\`git cat-file --batch\\` command. If any errors were encountered while starting that command, they will be returned immediately.\n\nOtherwise, an \\`\\*ObjectScanner\\` is returned with no error.\n\n```go\nfunc NewObjectScannerFrom(r io.Reader) *ObjectScanner\n```\nNewObjectScannerFrom returns a new \\`\\*ObjectScanner\\` populated with data from the given \\`io.Reader\\`, \"r\". It supplies no close function, and discards any input given to the Scan() function.\n\n```go\nfunc (s *ObjectScanner) Close() error\n```\nClose closes and frees any resources owned by the \\*ObjectScanner that it is called upon. If there were any errors in freeing that (those) resource(s), it it will be returned, otherwise nil.\n\n```go\nfunc (s *ObjectScanner) Contents() io.Reader\n```\nContents returns an io.Reader which reads Git's representation of the object that was last scanned for.\n\n```go\nfunc (s *ObjectScanner) Err() error\n```\nErr returns the error (if any) that was encountered during the last Scan() operation.\n\n```go\nfunc (s *ObjectScanner) Scan(oid string) bool\n```\nScan scans for a particular object given by the \"oid\" parameter. Once the scan is complete, the Contents(), Sha1(), Size() and Type() functions may be called and will return data corresponding to the given OID.\n\nScan() returns whether the scan was successful, or in other words, whether or not the scanner can continue to progress.\n\n```go\nfunc (s *ObjectScanner) Sha1() string\n```\nSha1 returns the SHA1 object ID of the object that was last scanned for.\n\n```go\nfunc (s *ObjectScanner) Size() int64\n```\nSize returns the size in bytes of the object that was last scanned for.\n\n```go\nfunc (s *ObjectScanner) Type() string\n```\nType returns the type of the object that was last scanned for.\n\n```go\ntype PktlineWriter struct {\n\t// contains filtered or unexported fields\n}\n```\nPktlineWriter is an implementation of \\`io.Writer\\` which writes data buffers \"p\" to an underlying pkt-line stream for use with the Git pkt-line format.\n\n```go\nfunc NewPktlineWriter(w io.Writer, c int) *PktlineWriter\n```\nNewPktlineWriter returns a new \\*PktlineWriter, which will write to the underlying data stream \"w\". The internal buffer is initialized with the given capacity, \"c\".\n\nIf \"w\" is already a \\`\\*PktlineWriter\\`, it will be returned as-is.\n\n```go\nfunc (w *PktlineWriter) Flush() error\n```\nFlush empties the internal buffer used to store data temporarily and then writes the pkt-line's FLUSH packet, to signal that it is done writing this chunk of data.\n\n```go\nfunc (w *PktlineWriter) Write(p []byte) (int, error)\n```\nWrite implements the io.Writer interface's \\`Write\\` method by providing a packet-based backend to the given buffer \"p\".\n\nAs many bytes are removed from \"p\" as possible and stored in an internal buffer until the amount of data in the internal buffer is enough to write a single packet. Once the internal buffer is full, a packet is written to the underlying stream of data, and the process repeats.\n\nWhen the caller has no more data to write in the given chunk of packets, a subsequent call to \\`Flush()\\` SHOULD be made in order to signify that the current pkt sequence has terminated, and a new one can begin.\n\nWrite returns the number of bytes in \"p\" accepted into the writer, which \\_MAY\\_ be written to the underlying protocol stream, or may be written into the internal buffer.\n\nIf any error was encountered while either buffering or writing, that error is returned, along with the number of bytes written to the underlying protocol stream, as described above.\n\n```go\ntype Ref struct {\n\tName string\n\tType RefType\n\tSha  string\n}\n```\nA git reference (branch, tag etc)\n\n```go\nfunc AllRefs() ([]*Ref, error)\n```\nAllRefs returns a slice of all references in a Git repository in the current working directory, or an error if those references could not be loaded.\n\n```go\nfunc AllRefsIn(wd string) ([]*Ref, error)\n```\nAllRefs returns a slice of all references in a Git repository located in a the given working directory \"wd\", or an error if those references could not be loaded.\n\n```go\nfunc CachedRemoteRefs(remoteName string) ([]*Ref, error)\n```\nCachedRemoteRefs returns the list of branches \u0026 tags for a remote which are currently cached locally. No remote request is made to verify them.\n\n```go\nfunc CurrentRef() (*Ref, error)\n```\n\n```go\nfunc GetAllWorkTreeHEADs(storageDir string) ([]*Ref, error)\n```\nGetAllWorkTreeHEADs returns the refs that all worktrees are using as HEADs This returns all worktrees plus the master working copy, and works even if working dir is actually in a worktree right now Pass in the git storage dir (parent of 'objects') to work from\n\n```go\nfunc LocalRefs() ([]*Ref, error)\n```\nRefs returns all of the local and remote branches and tags for the current repository. Other refs (HEAD, refs/stash, git notes) are ignored.\n\n```go\nfunc ParseRef(absRef, sha string) *Ref\n```\n\n```go\nfunc RecentBranches(since time.Time, includeRemoteBranches bool, onlyRemote string) ([]*Ref, error)\n```\nRecentBranches returns branches with commit dates on or after the given date/time Return full Ref type for easier detection of duplicate SHAs etc since: refs with commits on or after this date will be included includeRemoteBranches: true to include refs on remote branches onlyRemote: set to non-blank to only include remote branches on a single remote\n\n```go\nfunc RemoteRefs(remoteName string) ([]*Ref, error)\n```\nRemoteRefs returns a list of branches \u0026 tags for a remote by actually accessing the remote vir git ls-remote\n\n```go\nfunc ResolveRef(ref string) (*Ref, error)\n```\n\n```go\nfunc ResolveRefs(refnames []string) ([]*Ref, error)\n```\n\n```go\nfunc (r *Ref) Refspec() string\n```\nRefspec returns the fully-qualified reference name (including remote), i.e., for a remote branch called 'my-feature' on remote 'origin', this function will return:\n\n\trefs/remotes/origin/my-feature\n\n```go\ntype RefType int\n```\n\n```go\nfunc ParseRefToTypeAndName(fullref string) (t RefType, name string)\n```\nGet the type \u0026 name of a git reference\n\n```go\nfunc (t RefType) Prefix() (string, bool)\n```\nPrefix returns the given RefType's prefix, \"refs/heads\", \"ref/remotes\", etc. It returns an additional value of either true/false, whether or not this given ref type has a prefix.\n\nIf the RefType is unrecognized, Prefix() will panic.\n\n```go\ntype RefUpdate struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewRefUpdate(g Env, remote string, l, r *Ref) *RefUpdate\n```\n\n```go\nfunc (u *RefUpdate) Left() *Ref\n```\n\n```go\nfunc (u *RefUpdate) LeftCommitish() string\n```\n\n```go\nfunc (u *RefUpdate) Right() *Ref\n```\n\n```go\nfunc (u *RefUpdate) RightCommitish() string\n```\n\n```go\ntype Request struct {\n\t// Header maps header strings to values, and is encoded as the first\n\t// part of the packet.\n\tHeader map[string]string\n\t// Payload represents the body of the packet, and contains the contents\n\t// of the file in the index.\n\tPayload io.Reader\n}\n```\nRequest represents a single command sent to LFS from the parent Git process.\n\n```go\ntype RevListOrder int\n```\nRevListOrder is a constant type that allows for variation in the ordering of revisions given by the \\*RevListScanner below.\n\n```go\nconst (\n\t// DefaultRevListOrder is the zero-value for this type and yields the\n\t// results as given by git-rev-list(1) without any `--\u003ct\u003e-order`\n\t// argument given. By default: reverse chronological order.\n\tDefaultRevListOrder RevListOrder = iota\n\t// DateRevListOrder gives the revisions such that no parents are shown\n\t// before children, and otherwise in commit timestamp order.\n\tDateRevListOrder\n\t// AuthorDateRevListOrder gives the revisions such that no parents are\n\t// shown before children, and otherwise in author date timestamp order.\n\tAuthorDateRevListOrder\n\t// TopoRevListOrder gives the revisions such that they appear in\n\t// topological order.\n\tTopoRevListOrder\n)\n```\n\n```go\nfunc (o RevListOrder) Flag() (string, bool)\n```\nFlag returns the command-line flag to be passed to git-rev-list(1) in order to order the output according to the given RevListOrder. It returns both the flag (\"--date-order\", \"--topo-order\", etc) and a bool, whether or not to append the flag (for instance, DefaultRevListOrder requires no flag).\n\nGiven a type other than those defined above, Flag() will panic().\n\n```go\ntype RevListScanner struct {\n\t// contains filtered or unexported fields\n}\n```\nRevListScanner is a Scanner type that parses through results of the \\`git rev-list\\` command.\n\n```go\nfunc NewRevListScanner(include, excluded []string, opt *ScanRefsOptions) (*RevListScanner, error)\n```\nNewRevListScanner instantiates a new RevListScanner instance scanning all revisions reachable by refs contained in \"include\" and not reachable by any refs included in \"excluded\", using the \\*ScanRefsOptions \"opt\" configuration.\n\nIt returns a new \\*RevListScanner instance, or an error if one was encountered. Upon returning, the \\`git-rev-list(1)\\` instance is already running, and Scan() may be called immediately.\n\n```go\nfunc (s *RevListScanner) Close() error\n```\nClose closes the RevListScanner by freeing any resources held by the instance while running, and returns any error encountered while doing so.\n\n```go\nfunc (s *RevListScanner) Err() error\n```\nErr returns the last encountered error (or nil) after a call to Scan().\n\nIt SHOULD be called, checked and handled after a call to Scan().\n\n```go\nfunc (s *RevListScanner) Name() string\n```\nName is an optional field that gives the name of the object (if the object is a tree, blob).\n\nIt can be called before or after Scan(), but will return \"\" if called before.\n\n```go\nfunc (s *RevListScanner) OID() []byte\n```\nOID is the hex-decoded bytes of the object's ID.\n\nIt can be called before or after Scan(), but will return \"\" if called before.\n\n```go\nfunc (s *RevListScanner) Scan() bool\n```\nScan scans the next entry given by git-rev-list(1), and returns true/false indicating if there are more results to scan.\n\n```go\ntype ScanRefsOptions struct {\n\t// Mode is the scan mode to apply, see above.\n\tMode ScanningMode\n\t// Remote is the current remote to scan against, if using\n\t// ScanLeftToRemoveMode.\n\tRemote string\n\t// SkipDeletedBlobs specifies whether or not to traverse into commit\n\t// ancestry (revealing potentially deleted (unreferenced) blobs, trees,\n\t// or commits.\n\tSkipDeletedBlobs bool\n\t// Order specifies the order in which revisions are yielded from the\n\t// output of `git-rev-list(1)`. For more information, see the above\n\t// documentation on the RevListOrder type.\n\tOrder RevListOrder\n\t// CommitsOnly specifies whether or not the *RevListScanner should\n\t// return only commits, or all objects in range by performing a\n\t// traversal of the graph. By default, false: show all objects.\n\tCommitsOnly bool\n\t// WorkingDir specifies the working directory in which to run\n\t// git-rev-list(1). If this is an empty string, (has len(WorkingDir) ==\n\t// 0), it is equivalent to running in os.Getwd().\n\tWorkingDir string\n\t// Reverse specifies whether or not to give the revisions in reverse\n\t// order.\n\tReverse bool\n\n\t// SkippedRefs provides a list of refs to ignore.\n\tSkippedRefs []string\n\t// Mutex guards names.\n\tMutex *sync.Mutex\n\t// Names maps Git object IDs (encoded as hex using\n\t// hex.EncodeString()) to their names, i.e., a directory name\n\t// (fully-qualified) for trees, or a pathspec for blob tree entries.\n\tNames map[string]string\n}\n```\nScanRefsOptions is an \"options\" type that is used to configure a scan operation on the \\`\\*git.RevListScanner\\` instance when given to the function \\`NewRevListScanner()\\`.\n\n```go\nfunc (o *ScanRefsOptions) GetName(sha string) (string, bool)\n```\nGetName returns the name associated with a given blob/tree sha and \"true\" if it exists, or (\"\", false) if it doesn't.\n\nGetName is guarded by a use of o.Mutex, and is goroutine safe.\n\n```go\nfunc (o *ScanRefsOptions) SetName(sha, name string)\n```\nSetName sets the name associated with a given blob/tree sha.\n\nSetName is guarded by a use of o.Mutex, and is therefore goroutine safe.\n\n```go\ntype ScanningMode int\n```\nScanningMode is a constant type that allows for variation in the range of commits to scan when given to the \\`\\*git.RevListScanner\\` type.\n\n```go\nconst (\n\t// ScanRefsMode will scan between two refspecs.\n\tScanRefsMode ScanningMode = iota\n\t// ScanAllMode will scan all history.\n\tScanAllMode\n\t// ScanLeftToRemoteMode will scan the difference between any included\n\t// SHA1s and a remote tracking ref.\n\tScanLeftToRemoteMode\n)\n```\n\n","path":"github.com/duplexsystem/git-lfs/git","name":"git","synopsis":"Package git contains various commands that shell out to git NOTE: Subject to change, do not rely on this package from outside git-lfs source","isRedistributable":true}
