Documentation
¶
Index ¶
- Variables
- func Fork(repoPath, source string) error
- func InitBare(path, defaultBranch string) error
- type CommitCount
- type ConflictInfo
- type ErrMerge
- type GitRepo
- func (g *GitRepo) AnalyzeLanguages(ctx context.Context) (LangBreakdown, error)
- func (g *GitRepo) Branch(name string) (*plumbing.Reference, error)
- func (g *GitRepo) Branches() ([]types.Branch, error)
- func (g *GitRepo) Commit(h plumbing.Hash) (*object.Commit, error)
- func (g *GitRepo) Commits(offset, limit int) ([]*object.Commit, error)
- func (g *GitRepo) DeleteBranch(branch string) error
- func (g *GitRepo) Diff() (*types.NiceDiff, error)
- func (g *GitRepo) DiffTree(commit1, commit2 *object.Commit) (*types.DiffTree, error)
- func (g *GitRepo) FileContentN(path string, cap int64) ([]byte, error)
- func (g *GitRepo) FileTree(ctx context.Context, path string) ([]types.NiceTree, error)
- func (g *GitRepo) FindMainBranch() (string, error)
- func (g *GitRepo) FormatPatch(base, commit2 *object.Commit) (string, []types.FormatPatch, error)
- func (g *GitRepo) MergeCheck(patchData string, targetBranch string) error
- func (g *GitRepo) MergeWithOptions(patchData string, targetBranch string, opts MergeOptions) error
- func (g *GitRepo) RawContent(path string) ([]byte, error)
- func (g *GitRepo) RefUpdateMeta(line PostReceiveLine) (RefUpdateMeta, error)
- func (g *GitRepo) Refresh() error
- func (g *GitRepo) ResolveRevision(revStr string) (*object.Commit, error)
- func (g *GitRepo) SetDefaultBranch(branch string) error
- func (g *GitRepo) Submodule(path string) (*config.Submodule, error)
- func (g *GitRepo) Submodules() (*config.Modules, error)
- func (g *GitRepo) Sync() error
- func (g *GitRepo) Tags() ([]object.Tag, error)
- func (g *GitRepo) TotalCommits() (int, error)
- func (g *GitRepo) TrackHiddenRemoteRef(forkRef, remoteRef string) error
- func (g *GitRepo) Walk(ctx context.Context, root string, cb callback) error
- func (g *GitRepo) WriteTar(w io.Writer, prefix string) error
- type LangBreakdown
- type MergeCheckCache
- type MergeOptions
- type PostReceiveLine
- type RefUpdateMeta
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ErrMerge ¶
type ErrMerge struct {
Message string
Conflicts []ConflictInfo
HasConflict bool
OtherError error
}
type GitRepo ¶
type GitRepo struct {
// contains filtered or unexported fields
}
func (*GitRepo) AnalyzeLanguages ¶
func (g *GitRepo) AnalyzeLanguages(ctx context.Context) (LangBreakdown, error)
func (*GitRepo) DiffTree ¶
func (*GitRepo) FileContentN ¶
func (*GitRepo) FileTree ¶
func (*GitRepo) FormatPatch ¶
func (*GitRepo) MergeCheck ¶
func (*GitRepo) MergeWithOptions ¶
func (g *GitRepo) MergeWithOptions(patchData string, targetBranch string, opts MergeOptions) error
func (*GitRepo) RefUpdateMeta ¶
func (g *GitRepo) RefUpdateMeta(line PostReceiveLine) (RefUpdateMeta, error)
func (*GitRepo) Refresh ¶
re-open a repository and update references
func (*GitRepo) ResolveRevision ¶
func (*GitRepo) Submodules ¶
read and parse .gitmodules
func (*GitRepo) TrackHiddenRemoteRef ¶
TrackHiddenRemoteRef tracks a hidden remote in the repository. For example, if the feature branch on the fork (forkRef) is feature-1, and the remoteRef, i.e. the branch we want to merge into, is main, this will result in a refspec:
+refs/heads/main:refs/hidden/feature-1/main
func (*GitRepo) Walk ¶
type MergeCheckCache ¶
type MergeCheckCache struct {
// contains filtered or unexported fields
}
func (*MergeCheckCache) Get ¶
type MergeOptions ¶
type MergeOptions struct {
CommitMessage string
CommitBody string
AuthorName string
AuthorEmail string
CommitterName string
CommitterEmail string
FormatPatch bool
}
MergeOptions specifies the configuration for a merge operation
type PostReceiveLine ¶
type PostReceiveLine struct {
OldSha plumbing.Hash // old sha of reference being updated
NewSha plumbing.Hash // new sha of reference being updated
Ref string // the reference being updated
}
func ParsePostReceive ¶
func ParsePostReceive(buf io.Reader) ([]PostReceiveLine, error)
type RefUpdateMeta ¶
type RefUpdateMeta struct {
CommitCount CommitCount
IsDefaultRef bool
LangBreakdown LangBreakdown
}
func (RefUpdateMeta) AsRecord ¶
func (m RefUpdateMeta) AsRecord() tangled.GitRefUpdate_Meta
Source Files
¶
- branch.go
- cmd.go
- diff.go
- fork.go
- git.go
- language.go
- last_commit.go
- merge.go
- post_receive.go
- repo.go
- tag.go
- tree.go
Click to show internal directories.
Click to hide internal directories.