Versions in this module Expand all Collapse all v1 v1.24.5 Aug 14, 2025 Changes in this version + const BranchPrefix + const CmdSubVerbLfsDownload + const CmdSubVerbLfsUpload + const CmdVerbLfsAuthenticate + const CmdVerbLfsTransfer + const CmdVerbReceivePack + const CmdVerbUploadArchive + const CmdVerbUploadPack + const DefaultLocale + const ForPrefix + const NotesRef + const PullPrefix + const RemotePrefix + const RequiredVersion + const TagPrefix + var DefaultContext context.Context + var ErrBrokenCommand = errors.New("git command is broken") + var ErrNotValidHook = errors.New("not a valid Git hook") + var GitExecutable = "git" + func AddChanges(repoPath string, all bool, files ...string) error + func AddChangesWithArgs(repoPath string, globalArgs TrustedCmdArgs, all bool, files ...string) error + func AddTemplateSubmoduleIndexes(ctx context.Context, repoPath string, submodules []TemplateSubmoduleCommit) error + func AllCommitsCount(ctx context.Context, repoPath string, hidePRRefs bool, files ...string) (int64, error) + func BinToHex(objectFormat ObjectFormat, sha, out []byte) []byte + func Clone(ctx context.Context, from, to string, opts CloneRepoOptions) error + func CloneWithArgs(ctx context.Context, args TrustedCmdArgs, from, to string, ...) (err error) + func CommitChanges(repoPath string, opts CommitChangesOptions) error + func CommitChangesWithArgs(repoPath string, args TrustedCmdArgs, opts CommitChangesOptions) error + func CommitsCount(ctx context.Context, opts CommitsCountOptions) (int64, error) + func CommonCmdServEnvs() []string + func CommonGitCmdEnvs() []string + func ConcatenateError(err error, stderr string) error + func CutDiffAroundLine(originalDiff io.Reader, line int64, old bool, numbersOfLine int) (string, error) + func DiscardFull(rd *bufio.Reader, discard int64) error + func Fsck(ctx context.Context, repoPath string, timeout time.Duration, ...) error + func GetAffectedFiles(repo *Repository, branchName, oldCommitID, newCommitID string, env []string) ([]string, error) + func GetDefaultBranch(ctx context.Context, repoPath string) (string, error) + func GetDiffShortStatByCmdArgs(ctx context.Context, repoPath string, trustedArgs TrustedCmdArgs, ...) (numFiles, totalAdditions, totalDeletions int, err error) + func GetFullCommitID(ctx context.Context, repoPath, shortID string) (string, error) + func GetLastCommitForPaths(ctx context.Context, commit *Commit, treePath string, paths []string) (map[string]*Commit, error) + func GetLatestCommitTime(ctx context.Context, repoPath string) (time.Time, error) + func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note) error + func GetRawDiff(repo *Repository, commitID string, diffType RawDiffType, writer io.Writer) error + func GetRemoteAddress(ctx context.Context, repoPath, remoteName string) (string, error) + func GetRemoteURL(ctx context.Context, repoPath, remoteName string) (*giturl.GitURL, error) + func GetRepoRawDiffForFile(repo *Repository, startCommit, endCommit string, diffType RawDiffType, ...) error + func GetReverseRawDiff(ctx context.Context, repoPath, commitID string, writer io.Writer) error + func HashFilePathForWebUI(s string) string + func HomeDir() string + func InitFull(ctx context.Context) (err error) + func InitRepository(ctx context.Context, repoPath string, bare bool, objectFormatName string) error + func InitSimple(ctx context.Context) error + func IsAllowedVerbForServe(verb string) bool + func IsAllowedVerbForServeLfs(verb string) bool + func IsBranchExist(ctx context.Context, repoPath, name string) bool + func IsEmptyCommitID(commitID string) bool + func IsErrBranchNotExist(err error) bool + func IsErrCanceledOrKilled(err error) bool + func IsErrInvalidCloneAddr(err error) bool + func IsErrMoreThanOne(err error) bool + func IsErrNotExist(err error) bool + func IsErrPushOutOfDate(err error) bool + func IsErrPushRejected(err error) bool + func IsErrSymlinkUnresolved(err error) bool + func IsErrorExitCode(err error, code int) bool + func IsReferenceExist(ctx context.Context, repoPath, name string) bool + func IsRemoteNotExistError(err error) bool + func IsRepoURLAccessible(ctx context.Context, url string) bool + func IsStringLikelyCommitID(objFmt ObjectFormat, s string, minLength ...int) bool + func IsValidHookName(name string) bool + func IsValidObjectFormat(name string) bool + func IsValidRefPattern(name string) bool + func LogNameStatusRepo(ctx context.Context, repository, head, treepath string, paths ...string) (*bufio.Reader, func()) + func ParseBool(value string) (result, valid bool) + func ParseCatFileTreeLine(objectFormat ObjectFormat, rd *bufio.Reader, modeBuf, fnameBuf, shaBuf []byte) (mode, fname, sha []byte, n int, err error) + func ParseDiffHunkString(diffHunk string) (leftLine, leftHunk, rightLine, rightHunk int) + func ParseRemoteAddr(remoteAddr, authUsername, authPassword string) (string, error) + func Push(ctx context.Context, repoPath string, opts PushOptions) error + func ReadBatchLine(rd *bufio.Reader) (sha []byte, typ string, size int64, err error) + func ReadTagObjectID(rd *bufio.Reader, size int64) (string, error) + func ReadTreeID(rd *bufio.Reader, size int64) (string, error) + func SanitizeRefPattern(name string) string + func SetExecutablePath(path string) error + func SplitCommitTitleBody(commitMessage string, titleRuneLimit int) (title, body string) + func WalkGitLog(ctx context.Context, repo *Repository, head *Commit, treepath string, ...) (map[string]string, error) + func WalkShowRef(ctx context.Context, repoPath string, extraArgs TrustedCmdArgs, ...) (countAll int, err error) + func WriteCommitGraph(ctx context.Context, repoPath string) error + type ArchiveType int + const ArchiveBundle + const ArchiveTarGz + const ArchiveUnknown + const ArchiveZip + func SplitArchiveNameType(s string) (string, ArchiveType) + func (a ArchiveType) String() string + type Batch struct + Reader *bufio.Reader + Writer WriteCloserError + func NewBatch(ctx context.Context, repoPath string) (*Batch, error) + func NewBatchCheck(ctx context.Context, repoPath string) (*Batch, error) + func (b *Batch) Close() + type BlamePart struct + Lines []string + PreviousPath string + PreviousSha string + Sha string + type BlameReader struct + func CreateBlameReader(ctx context.Context, objectFormat ObjectFormat, repoPath string, ...) (rd *BlameReader, err error) + func (r *BlameReader) Close() error + func (r *BlameReader) NextPart() (*BlamePart, error) + func (r *BlameReader) UsesIgnoreRevs() bool + type Blob struct + ID ObjectID + func (b *Blob) DataAsync() (io.ReadCloser, error) + func (b *Blob) GetBlobContent(limit int64) (string, error) + func (b *Blob) GetBlobContentBase64() (string, error) + func (b *Blob) GetBlobLineCount(w io.Writer) (int, error) + func (b *Blob) GuessContentType() (typesniffer.SniffedType, error) + func (b *Blob) Name() string + func (b *Blob) Size() int64 + type CloneRepoOptions struct + Bare bool + Branch string + Depth int + Filter string + Mirror bool + NoCheckout bool + Quiet bool + Shared bool + SkipTLSVerify bool + Timeout time.Duration + type CodeActivityAuthor struct + Commits int64 + Email string + Name string + type CodeActivityStats struct + Additions int64 + AuthorCount int64 + Authors []*CodeActivityAuthor + ChangedFiles int64 + CommitCount int64 + CommitCountInAllBranches int64 + Deletions int64 + type Command struct + func NewCommand(args ...internal.CmdArg) *Command + func NewCommandNoGlobals(args ...internal.CmdArg) *Command + func (c *Command) AddArguments(args ...internal.CmdArg) *Command + func (c *Command) AddDashesAndList(list ...string) *Command + func (c *Command) AddDynamicArguments(args ...string) *Command + func (c *Command) AddOptionFormat(opt string, args ...any) *Command + func (c *Command) AddOptionValues(opt internal.CmdArg, args ...string) *Command + func (c *Command) LogString() string + func (c *Command) ProcessState() string + func (c *Command) Run(ctx context.Context, opts *RunOpts) error + func (c *Command) RunStdBytes(ctx context.Context, opts *RunOpts) (stdout, stderr []byte, runErr RunStdError) + func (c *Command) RunStdString(ctx context.Context, opts *RunOpts) (stdout, stderr string, runErr RunStdError) + type Commit struct + Author *Signature + CommitMessage string + Committer *Signature + ID ObjectID + Parents []ObjectID + Signature *CommitSignature + func CommitFromReader(gitRepo *Repository, objectID ObjectID, reader io.Reader) (*Commit, error) + func (c *Commit) CacheCommit(ctx context.Context) error + func (c *Commit) CommitsBefore() ([]*Commit, error) + func (c *Commit) CommitsBeforeLimit(num int) ([]*Commit, error) + func (c *Commit) CommitsBeforeUntil(commitID string) ([]*Commit, error) + func (c *Commit) CommitsByRange(page, pageSize int, not string) ([]*Commit, error) + func (c *Commit) CommitsCount() (int64, error) + func (c *Commit) FileChangedSinceCommit(filename, pastCommit string) (bool, error) + func (c *Commit) GetBranchName() (string, error) + func (c *Commit) GetCommitByPath(relpath string) (*Commit, error) + func (c *Commit) GetFileContent(filename string, limit int) (string, error) + func (c *Commit) GetFilesChangedSinceCommit(pastCommit string) ([]string, error) + func (c *Commit) GetRepositoryDefaultPublicGPGKey(forceUpdate bool) (*GPGSettings, error) + func (c *Commit) GetSubModule(entryName string) (*SubModule, error) + func (c *Commit) GetSubModules() (*ObjectCache[*SubModule], error) + func (c *Commit) HasFile(filename string) (bool, error) + func (c *Commit) HasPreviousCommit(objectID ObjectID) (bool, error) + func (c *Commit) IsForcePush(oldCommitID string) (bool, error) + func (c *Commit) Message() string + func (c *Commit) Parent(n int) (*Commit, error) + func (c *Commit) ParentCount() int + func (c *Commit) ParentID(n int) (ObjectID, error) + func (c *Commit) SearchCommits(opts SearchCommitsOptions) ([]*Commit, error) + func (c *Commit) Summary() string + type CommitChangesOptions struct + Author *Signature + Committer *Signature + Message string + type CommitFileStatus struct + Added []string + Modified []string + Removed []string + func GetCommitFileStatus(ctx context.Context, repoPath, commitID string) (*CommitFileStatus, error) + func NewCommitFileStatus() *CommitFileStatus + type CommitInfo struct + Commit *Commit + Entry *TreeEntry + SubmoduleFile *CommitSubmoduleFile + type CommitSignature struct + Payload string + Signature string + type CommitSubmoduleFile struct + func GetCommitInfoSubmoduleFile(repoLink, fullPath string, commit *Commit, refCommitID ObjectID) (*CommitSubmoduleFile, error) + func NewCommitSubmoduleFile(repoLink, fullPath, refURL, refID string) *CommitSubmoduleFile + func (sf *CommitSubmoduleFile) RefID() string + func (sf *CommitSubmoduleFile) SubmoduleWebLinkCompare(ctx context.Context, commitID1, commitID2 string) *SubmoduleWebLink + func (sf *CommitSubmoduleFile) SubmoduleWebLinkTree(ctx context.Context, optCommitID ...string) *SubmoduleWebLink + type CommitTreeOpts struct + AlwaysSign bool + KeyID string + Message string + NoGPGSign bool + Parents []string + type CommitsByFileAndRangeOptions struct + File string + Not string + Page int + Revision string + type CommitsCountOptions struct + Not string + RelPath []string + RepoPath string + Revision []string + type CompareInfo struct + BaseCommitID string + Commits []*Commit + HeadCommitID string + MergeBase string + NumFiles int + type DeleteBranchOptions struct + Force bool + type DivergeObject struct + Ahead int + Behind int + func GetDivergingCommits(ctx context.Context, repoPath, baseBranch, targetBranch string) (do DivergeObject, err error) + type EmptyReader struct + func (EmptyReader) Read(p []byte) (int, error) + type Entries []*TreeEntry + func (tes Entries) CustomSort(cmp func(s1, s2 string) bool) + func (tes Entries) GetCommitsInfo(ctx context.Context, repoLink string, commit *Commit, treePath string) ([]CommitInfo, *Commit, error) + func (tes Entries) Sort() + type EntryMode int + const EntryModeBlob + const EntryModeCommit + const EntryModeExec + const EntryModeNoEntry + const EntryModeSymlink + const EntryModeTree + func ParseEntryMode(mode string) (EntryMode, error) + func (e EntryMode) IsDir() bool + func (e EntryMode) IsExecutable() bool + func (e EntryMode) IsLink() bool + func (e EntryMode) IsRegular() bool + func (e EntryMode) IsSubModule() bool + func (e EntryMode) String() string + type ErrBranchNotExist struct + Name string + func (err ErrBranchNotExist) Error() string + func (err ErrBranchNotExist) Unwrap() error + type ErrInvalidCloneAddr struct + Host string + IsInvalidPath bool + IsPermissionDenied bool + IsProtocolInvalid bool + IsURLError bool + LocalPath bool + func (err *ErrInvalidCloneAddr) Error() string + func (err *ErrInvalidCloneAddr) Unwrap() error + type ErrInvalidSHA struct + SHA string + func (err ErrInvalidSHA) Error() string + type ErrMoreThanOne struct + Err error + StdErr string + StdOut string + func (err *ErrMoreThanOne) Error() string + type ErrNotExist struct + ID string + RelPath string + func (err ErrNotExist) Error() string + func (err ErrNotExist) Unwrap() error + type ErrPushOutOfDate struct + Err error + StdErr string + StdOut string + func (err *ErrPushOutOfDate) Error() string + func (err *ErrPushOutOfDate) Unwrap() error + type ErrPushRejected struct + Err error + Message string + StdErr string + StdOut string + func (err *ErrPushRejected) Error() string + func (err *ErrPushRejected) GenerateMessage() + func (err *ErrPushRejected) Unwrap() error + type ErrSymlinkUnresolved struct + Message string + Name string + func (err ErrSymlinkUnresolved) Error() string + type Features struct + SupportCheckAttrOnBare bool + SupportHashSha256 bool + SupportProcReceive bool + SupportedObjectFormats []ObjectFormat + UsingGogit bool + func DefaultFeatures() *Features + func (f *Features) CheckVersionAtLeast(atLeast string) bool + func (f *Features) VersionInfo() string + type GPGSettings struct + Email string + KeyID string + Name string + PublicKeyContent string + Sign bool + func (gpgSettings *GPGSettings) LoadPublicKeyContent() error + type GrepModeType string + const GrepModeExact + const GrepModeRegexp + const GrepModeWords + type GrepOptions struct + ContextLineNumber int + GrepMode GrepModeType + MaxLineLength int + MaxResultLimit int + PathspecList []string + RefName string + type GrepResult struct + Filename string + LineCodes []string + LineNumbers []int + func GrepSearch(ctx context.Context, repo *Repository, search string, opts GrepOptions) ([]*GrepResult, error) + type Hook struct + Content string + IsActive bool + Sample string + func GetHook(repoPath, name string) (*Hook, error) + func ListHooks(repoPath string) (_ []*Hook, err error) + func (h *Hook) Name() string + func (h *Hook) Update() error + type IndexObjectInfo struct + Filename string + Mode string + Object ObjectID + type LastCommitCache struct + func NewLastCommitCache(count int64, repoPath string, gitRepo *Repository, cache cache.StringCache) *LastCommitCache + func (c *LastCommitCache) Get(ref, entryPath string) (*Commit, error) + func (c *LastCommitCache) GetCommitByPath(commitID, entryPath string) (*Commit, error) + func (c *LastCommitCache) Put(ref, entryPath, commitID string) error + type LimitedReaderCloser struct + C io.Closer + N int64 + R io.Reader + func (l *LimitedReaderCloser) Close() error + func (l *LimitedReaderCloser) Read(p []byte) (n int, err error) + type LogNameStatusCommitData struct + CommitID string + ParentIDs []string + Paths []bool + type LogNameStatusRepoParser struct + func NewLogNameStatusRepoParser(ctx context.Context, repository, head, treepath string, paths ...string) *LogNameStatusRepoParser + func (g *LogNameStatusRepoParser) Close() + func (g *LogNameStatusRepoParser) Next(treepath string, paths2ids map[string]int, changed []bool, maxpathlen int) (*LogNameStatusCommitData, error) + type LsTreeEntry struct + EntryMode EntryMode + ID ObjectID + Name string + Size optional.Option[int64] + type Note struct + Commit *Commit + Message []byte + type ObjectCache struct + func (oc *ObjectCache[T]) Get(id string) (T, bool) + func (oc *ObjectCache[T]) Set(id string, obj T) + type ObjectFormat interface + ComputeHash func(t ObjectType, content []byte) ObjectID + EmptyObjectID func() ObjectID + EmptyTree func() ObjectID + FullLength func() int + IsValid func(input string) bool + MustID func(b []byte) ObjectID + Name func() string + var Sha1ObjectFormat ObjectFormat = Sha1ObjectFormatImpl{} + var Sha256ObjectFormat ObjectFormat = Sha256ObjectFormatImpl{} + func ObjectFormatFromName(name string) ObjectFormat + type ObjectID interface + IsZero func() bool + RawValue func() []byte + String func() string + Type func() ObjectFormat + func ComputeBlobHash(hashType ObjectFormat, content []byte) ObjectID + func MustIDFromString(hexHash string) ObjectID + func NewIDFromString(hexHash string) (ObjectID, error) + type ObjectType string + const ObjectBlob + const ObjectBranch + const ObjectCommit + const ObjectTag + const ObjectTree + func (o ObjectType) Bytes() []byte + type PushOptions struct + Branch string + Env []string + Force bool + Mirror bool + Remote string + Timeout time.Duration + type RawDiffType string + const RawDiffNormal + const RawDiffPatch + type RefName string + func RefNameFromBranch(shortName string) RefName + func RefNameFromCommit(shortName string) RefName + func RefNameFromTag(shortName string) RefName + func (ref RefName) BranchName() string + func (ref RefName) ForBranchName() string + func (ref RefName) IsBranch() bool + func (ref RefName) IsFor() bool + func (ref RefName) IsPull() bool + func (ref RefName) IsRemote() bool + func (ref RefName) IsTag() bool + func (ref RefName) PullName() string + func (ref RefName) RefGroup() string + func (ref RefName) RefType() RefType + func (ref RefName) RefWebLinkPath() string + func (ref RefName) RemoteName() string + func (ref RefName) ShortName() string + func (ref RefName) String() string + func (ref RefName) TagName() string + type RefType string + const RefTypeBranch + const RefTypeCommit + const RefTypeTag + type Reference struct + Name string + Object ObjectID + Type string + func (ref *Reference) Commit() (*Commit, error) + func (ref *Reference) RefGroup() string + func (ref *Reference) ShortName() string + type Repository struct + Ctx context.Context + LastCommitCache *LastCommitCache + Path string + func OpenRepository(ctx context.Context, repoPath string) (*Repository, error) + func (repo *Repository) AddLastCommitCache(cacheKey, fullName, sha string) error + func (repo *Repository) AddObjectToIndex(mode string, object ObjectID, filename string) error + func (repo *Repository) AddObjectsToIndex(objects ...IndexObjectInfo) error + func (repo *Repository) AddRemote(name, url string, fetch bool) error + func (repo *Repository) CatFileBatch(ctx context.Context) (WriteCloserError, *bufio.Reader, func(), error) + func (repo *Repository) CatFileBatchCheck(ctx context.Context) (WriteCloserError, *bufio.Reader, func(), error) + func (repo *Repository) Close() error + func (repo *Repository) CommitTree(author, committer *Signature, tree *Tree, opts CommitTreeOpts) (ObjectID, error) + func (repo *Repository) CommitsBetween(last, before *Commit) ([]*Commit, error) + func (repo *Repository) CommitsBetweenIDs(last, before string) ([]*Commit, error) + func (repo *Repository) CommitsBetweenLimit(last, before *Commit, limit, skip int) ([]*Commit, error) + func (repo *Repository) CommitsBetweenNotBase(last, before *Commit, baseBranch string) ([]*Commit, error) + func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions) ([]*Commit, error) + func (repo *Repository) CommitsCountBetween(start, end string) (int64, error) + func (repo *Repository) ConvertToGitID(commitID string) (ObjectID, error) + func (repo *Repository) CreateAnnotatedTag(name, message, revision string) error + func (repo *Repository) CreateArchive(ctx context.Context, format ArchiveType, target io.Writer, usePrefix bool, ...) error + func (repo *Repository) CreateBranch(branch, oldbranchOrCommit string) error + func (repo *Repository) CreateBundle(ctx context.Context, commit string, out io.Writer) error + func (repo *Repository) CreateTag(name, revision string) error + func (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) error + func (repo *Repository) EmptyIndex() error + func (repo *Repository) FileChangedBetweenCommits(filename, id1, id2 string) (bool, error) + func (repo *Repository) FileCommitsCount(revision, file string) (int64, error) + func (repo *Repository) FilesCountBetween(startCommitID, endCommitID string) (int, error) + func (repo *Repository) GetAllCommitsCount() (int64, error) + func (repo *Repository) GetAnnotatedTag(sha string) (*Tag, error) + func (repo *Repository) GetBlob(idStr string) (*Blob, error) + func (repo *Repository) GetBranchCommit(name string) (*Commit, error) + func (repo *Repository) GetBranchCommitID(name string) (string, error) + func (repo *Repository) GetBranchNames(skip, limit int) ([]string, int, error) + func (repo *Repository) GetCodeActivityStats(fromTime time.Time, branch string) (*CodeActivityStats, error) + func (repo *Repository) GetCommit(commitID string) (*Commit, error) + func (repo *Repository) GetCommitBranchStart(env []string, branch, endCommitID string) (string, error) + func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) + func (repo *Repository) GetCommitsFromIDs(commitIDs []string) []*Commit + func (repo *Repository) GetCompareInfo(basePath, baseBranch, headBranch string, directComparison, fileOnly bool) (_ *CompareInfo, err error) + func (repo *Repository) GetDefaultPublicGPGKey(forceUpdate bool) (*GPGSettings, error) + func (repo *Repository) GetDiff(compareArg string, w io.Writer) error + func (repo *Repository) GetDiffBinary(compareArg string, w io.Writer) error + func (repo *Repository) GetDiffNumChangedFiles(base, head string, directComparison bool) (int, error) + func (repo *Repository) GetFilesChangedBetween(base, head string) ([]string, error) + func (repo *Repository) GetHook(name string) (*Hook, error) + func (repo *Repository) GetMergeBase(tmpRemote, base, head string) (string, string, error) + func (repo *Repository) GetObjectFormat() (ObjectFormat, error) + func (repo *Repository) GetPatch(compareArg string, w io.Writer) error + func (repo *Repository) GetRefCommitID(name string) (string, error) + func (repo *Repository) GetRefs() ([]*Reference, error) + func (repo *Repository) GetRefsBySha(sha, prefix string) ([]string, error) + func (repo *Repository) GetRefsFiltered(pattern string) ([]*Reference, error) + func (repo *Repository) GetTag(name string) (*Tag, error) + func (repo *Repository) GetTagCommit(name string) (*Commit, error) + func (repo *Repository) GetTagCommitID(name string) (string, error) + func (repo *Repository) GetTagID(name string) (string, error) + func (repo *Repository) GetTagInfos(page, pageSize int) ([]*Tag, int, error) + func (repo *Repository) GetTagNameBySHA(sha string) (string, error) + func (repo *Repository) GetTagType(id ObjectID) (string, error) + func (repo *Repository) GetTagWithID(idStr, name string) (*Tag, error) + func (repo *Repository) GetTags(skip, limit int) (tags []string, err error) + func (repo *Repository) GetTree(idStr string) (*Tree, error) + func (repo *Repository) GetTreePathLatestCommit(refName, treePath string) (*Commit, error) + func (repo *Repository) HashObject(reader io.Reader) (ObjectID, error) + func (repo *Repository) Hooks() ([]*Hook, error) + func (repo *Repository) IsBranchExist(name string) bool + func (repo *Repository) IsCommitExist(name string) bool + func (repo *Repository) IsCommitInBranch(commitID, branch string) (r bool, err error) + func (repo *Repository) IsEmpty() (bool, error) + func (repo *Repository) IsObjectExist(name string) bool + func (repo *Repository) IsReferenceExist(name string) bool + func (repo *Repository) IsTagExist(name string) bool + func (repo *Repository) LineBlame(revision, path, file string, line uint) (*Commit, error) + func (repo *Repository) ListOccurrences(ctx context.Context, refType, commitSHA string) ([]string, error) + func (repo *Repository) LsFiles(filenames ...string) ([]string, error) + func (repo *Repository) LsTree(ref string, filenames ...string) ([]string, error) + func (repo *Repository) ReadPatchCommit(prID int64) (commitSHA string, err error) + func (repo *Repository) ReadTreeToIndex(treeish string, indexFilename ...string) error + func (repo *Repository) ReadTreeToTemporaryIndex(treeish string) (tmpIndexFilename, tmpDir string, cancel context.CancelFunc, err error) + func (repo *Repository) RemoveFilesFromIndex(filenames ...string) error + func (repo *Repository) RemoveReference(name string) error + func (repo *Repository) RemoveRemote(name string) error + func (repo *Repository) RenameBranch(from, to string) error + func (repo *Repository) ResolveReference(name string) (string, error) + func (repo *Repository) SetReference(name, commitID string) error + func (repo *Repository) UnstableGuessRefByShortName(shortName string) RefName + func (repo *Repository) WalkReferences(refType ObjectType, skip, limit int, walkfn func(sha1, refname string) error) (int, error) + func (repo *Repository) WriteTree() (*Tree, error) + type RunOpts struct + Dir string + Env []string + PipelineFunc func(context.Context, context.CancelFunc) error + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + Timeout time.Duration + UseContextTimeout bool + type RunStdError interface + Stderr func() string + Unwrap func() error + type SearchCommitsOptions struct + After string + All bool + Authors []string + Before string + Committers []string + Keywords []string + func NewSearchCommitsOptions(searchString string, forAllRefs bool) SearchCommitsOptions + type Sha1Hash [20]byte + func (*Sha1Hash) Type() ObjectFormat + func (h *Sha1Hash) IsZero() bool + func (h *Sha1Hash) RawValue() []byte + func (h *Sha1Hash) String() string + type Sha1ObjectFormatImpl struct + func (Sha1ObjectFormatImpl) EmptyObjectID() ObjectID + func (Sha1ObjectFormatImpl) EmptyTree() ObjectID + func (Sha1ObjectFormatImpl) FullLength() int + func (Sha1ObjectFormatImpl) IsValid(input string) bool + func (Sha1ObjectFormatImpl) MustID(b []byte) ObjectID + func (Sha1ObjectFormatImpl) Name() string + func (h Sha1ObjectFormatImpl) ComputeHash(t ObjectType, content []byte) ObjectID + type Sha256Hash [32]byte + func (*Sha256Hash) Type() ObjectFormat + func (h *Sha256Hash) IsZero() bool + func (h *Sha256Hash) RawValue() []byte + func (h *Sha256Hash) String() string + type Sha256ObjectFormatImpl struct + func (Sha256ObjectFormatImpl) EmptyObjectID() ObjectID + func (Sha256ObjectFormatImpl) EmptyTree() ObjectID + func (Sha256ObjectFormatImpl) FullLength() int + func (Sha256ObjectFormatImpl) IsValid(input string) bool + func (Sha256ObjectFormatImpl) MustID(b []byte) ObjectID + func (Sha256ObjectFormatImpl) Name() string + func (h Sha256ObjectFormatImpl) ComputeHash(t ObjectType, content []byte) ObjectID + type Signature struct + Email string + Name string + When time.Time + func (s *Signature) Decode(b []byte) + func (s *Signature) String() string + type SubModule struct + Branch string + Path string + URL string + type SubmoduleWebLink struct + CommitWebLink string + RepoWebLink string + type Tag struct + ID ObjectID + Message string + Name string + Object ObjectID + Signature *CommitSignature + Tagger *Signature + Type string + type TemplateSubmoduleCommit struct + Commit string + Path string + func GetTemplateSubmoduleCommits(ctx context.Context, repoPath string) (submoduleCommits []TemplateSubmoduleCommit, _ error) + type Tree struct + ID ObjectID + ResolvedID ObjectID + func NewTree(repo *Repository, id ObjectID) *Tree + func (t *Tree) GetBlobByPath(relpath string) (*Blob, error) + func (t *Tree) GetTreeEntryByPath(relpath string) (*TreeEntry, error) + func (t *Tree) ListEntries() (Entries, error) + func (t *Tree) ListEntriesRecursiveFast() (Entries, error) + func (t *Tree) ListEntriesRecursiveWithSize() (Entries, error) + func (t *Tree) SubTree(rpath string) (*Tree, error) + type TreeEntry struct + ID ObjectID + func ParseTreeEntries(data []byte) ([]*TreeEntry, error) + func (te *TreeEntry) Blob() *Blob + func (te *TreeEntry) FollowLink() (*TreeEntry, error) + func (te *TreeEntry) FollowLinks(optLimit ...int) (*TreeEntry, error) + func (te *TreeEntry) GetSubJumpablePathName() string + func (te *TreeEntry) IsDir() bool + func (te *TreeEntry) IsExecutable() bool + func (te *TreeEntry) IsLink() bool + func (te *TreeEntry) IsRegular() bool + func (te *TreeEntry) IsSubModule() bool + func (te *TreeEntry) Mode() EntryMode + func (te *TreeEntry) Name() string + func (te *TreeEntry) Size() int64 + func (te *TreeEntry) Tree() *Tree + func (te *TreeEntry) Type() string + type TrustedCmdArgs []internal.CmdArg + func AllowLFSFiltersArgs() TrustedCmdArgs + func ToTrustedCmdArgs(args []string) TrustedCmdArgs + type WriteCloserError interface + CloseWithError func(err error) error