Documentation
¶
Index ¶
- Constants
- Variables
- func EncodedObjectHeader(encoded plumbing.EncodedObject) string
- func FindGitDir(startDir string) (string, error)
- func NewDeepTreeDir(git *CASGit, deepTree *gitobjects.DeepTreeObject) gitindex.TreeDirectory
- func RefSpecsMatch(ref string, specs []RefSpec) (string, bool)
- func RefSpecsPrefix(specs []RefSpec) string
- func SetupCentralCommitMsgHook(ctx context.Context, store entities.CASStore, casfs bindcas.CASFS, ...)
- func Walk(ctx context.Context, dirHash entities.Hash, store entities.CASStore, ...) error
- func WriteFileAtomic(filename string, data []byte, perm os.FileMode) (retErr error)
- func WriteGitConfig(gitDir string, cfg *GitConfig) error
- type Branch
- type CASGit
- func (g *CASGit) Checkout(ctx context.Context, opts CheckoutOptions) error
- func (g *CASGit) Clone(ctx context.Context, opts CloneOptions) error
- func (g *CASGit) Fetch(ctx context.Context, opts FetchOptions) error
- func (g CASGit) GetCommit(ctx context.Context, key entities.Hash) (*object.Commit, error)
- func (g *CASGit) GetSymRef(ctx context.Context, server string, project string, ref string) (string, error)
- func (g CASGit) ResolveCommit(ctx context.Context, key entities.Hash) (*object.Commit, error)
- func (g *CASGit) ResolveRef(ctx context.Context, server, project, ref string) (entities.Hash, string, error)
- func (g *CASGit) WriteIndexFromCASFS(workDir string, commitHash entities.Hash, indexFilePath string) error
- func (g *CASGit) WriteIndexFromDeepTree(workDir string, deepTree *gitobjects.DeepTreeObject, indexFilePath string) error
- type CheckoutOptions
- type CloneOptions
- type ConfigGroup
- type FetchOptions
- type GitCheckout
- type GitClone
- type GitConfig
- func (c *GitConfig) Add(key, value string) error
- func (c *GitConfig) Get(key string) (string, bool, error)
- func (c *GitConfig) GetAll(key string) ([]string, error)
- func (c *GitConfig) Group(prefix string) []ConfigGroup
- func (c *GitConfig) KeysWithPrefix(prefix string) []string
- func (c *GitConfig) Set(key, value string) error
- func (c *GitConfig) Unset(key string) error
- func (c *GitConfig) Write(w io.Writer) error
- type GitFetch
- type GitRepo
- func (r *GitRepo) AddConfig(key, value string) error
- func (r *GitRepo) CurrentBranch() (*Branch, error)
- func (r *GitRepo) DiffHeadTree(ctx context.Context, treeHash entities.Hash) ([]dirsync.DiffAction, error)
- func (r *GitRepo) DiffHeadWorkDir(ctx context.Context) ([]dirsync.DiffAction, error)
- func (r *GitRepo) GetAllConfig(key string) ([]string, error)
- func (r *GitRepo) GetBranch(name string) *Branch
- func (r *GitRepo) GetConfig(key, defaultValue string) (string, error)
- func (r *GitRepo) GetRemote(remote string) (*Remote, error)
- func (r *GitRepo) HasUncommitedChanges() (bool, error)
- func (r *GitRepo) IsDetached() bool
- func (r *GitRepo) Load() error
- func (r *GitRepo) LoadConfig() (retErr error)
- func (r *GitRepo) LocalCommits(branchName string) ([]string, error)
- func (r *GitRepo) Project() string
- func (r *GitRepo) RebaseCommitsOnto(projectName string, localCommits []string, revision string) error
- func (r *GitRepo) RevParse(ref string) (string, error)
- func (r *GitRepo) Server() string
- func (r *GitRepo) SetConfig(key, value string) error
- func (r *GitRepo) UnsetConfig(key string) error
- func (r *GitRepo) UpdateLocalBranchToHead(projectName string, branchName string) error
- type Hash
- type RefSpec
- type RefUpdate
- type Remote
- type WalkFunc
Constants ¶
View Source
const ( RepoPacksDir = "packs" RepoDirName = ".repo" )
Variables ¶
View Source
var ( ErrWalkStop = errors.New("stop the walk") ErrWalkNoStepIn = errors.New("do not step into dir") )
Functions ¶
func EncodedObjectHeader ¶
func EncodedObjectHeader(encoded plumbing.EncodedObject) string
func FindGitDir ¶
func NewDeepTreeDir ¶
func NewDeepTreeDir(git *CASGit, deepTree *gitobjects.DeepTreeObject) gitindex.TreeDirectory
NewDeepTreeDir creates a TreeDirectory root from a DeepTreeObject.
func RefSpecsMatch ¶
RefSpecsMatch determines if the given reference matches the provided list of RefSpecs. A reference is considered matching if:
- It does not match any negative RefSpec.
- Either no positive specs are specified or it matches at least one positive RefSpec.
func RefSpecsPrefix ¶
func WriteFileAtomic ¶
func WriteGitConfig ¶
Types ¶
type Branch ¶
type Branch struct {
Name string
Remote string
Merge string
Rebase bool
PushRemote string
Description string
}
func (*Branch) TrackingRef ¶
type CASGit ¶
type CASGit struct {
// contains filtered or unexported fields
}
func (*CASGit) Checkout ¶
func (g *CASGit) Checkout(ctx context.Context, opts CheckoutOptions) error
func (CASGit) ResolveCommit ¶
ResolveCommit will return the Commit object for a hash referencing a commit or a tag
func (*CASGit) ResolveRef ¶
func (*CASGit) WriteIndexFromCASFS ¶
func (*CASGit) WriteIndexFromDeepTree ¶
func (g *CASGit) WriteIndexFromDeepTree(workDir string, deepTree *gitobjects.DeepTreeObject, indexFilePath string) error
type CheckoutOptions ¶
type CheckoutOptions struct {
Target string
Paths []string
NewBranch string
NewBranchForce string
Orphan string
Track string
NoTrack bool
GuessRemote bool
NoGuess bool
Detach bool
Force bool
Merge bool
ConflictStyle string
Quiet bool
Progress bool
NoProgress bool
Theirs bool
Ours bool
Patch bool
Overlay bool
NoOverlay bool
PathspecFromFile string
PathspecFileNUL bool
RecurseSubmodules string
NoRecurseSubmodules bool
IgnoreSkipWorktreeBits bool
IgnoreOtherWorktrees bool
GitDir string
ObjectDir string
WorkDir string
}
type CloneOptions ¶
type ConfigGroup ¶
type FetchOptions ¶
type GitCheckout ¶
type GitCheckout struct {
CheckoutOptions
*GitRepo
// contains filtered or unexported fields
}
type GitClone ¶
type GitClone struct {
CloneOptions
*GitRepo
// contains filtered or unexported fields
}
type GitConfig ¶
type GitConfig struct {
// contains filtered or unexported fields
}
func ReadGitConfig ¶
func (*GitConfig) Group ¶
func (c *GitConfig) Group(prefix string) []ConfigGroup
func (*GitConfig) KeysWithPrefix ¶
type GitFetch ¶
type GitFetch struct {
FetchOptions
*GitRepo
// contains filtered or unexported fields
}
type GitRepo ¶
type GitRepo struct {
// contains filtered or unexported fields
}
func NewGitRepo ¶
func (*GitRepo) CurrentBranch ¶
func (*GitRepo) DiffHeadTree ¶
func (*GitRepo) DiffHeadWorkDir ¶
func (*GitRepo) HasUncommitedChanges ¶
func (*GitRepo) IsDetached ¶
func (*GitRepo) LoadConfig ¶
func (*GitRepo) RebaseCommitsOnto ¶
func (*GitRepo) UnsetConfig ¶
type RefUpdate ¶
type RefUpdate struct {
SourceRef string
DestRef string
OldHash entities.Hash
NewHash entities.Hash
}
func (*RefUpdate) LongFormat ¶
Click to show internal directories.
Click to hide internal directories.