git

package
v2.24.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGitInfo added in v2.22.0

func BuildGitInfo(ctx context.Context, repoRoot string, projectDir string) (result.GitInfo, result.ProjectKey, error)

func DetectGitRepositoryRoot

func DetectGitRepositoryRoot(path string) (string, error)

func GetWorktreeStatus added in v2.20.5

func GetWorktreeStatus(ctx context.Context, path string) (git.Status, error)

GetWorktreeStatus returns the worktree status of the given repo When modified files are found, it will invoke the git binary for "git status --porcelain" to check that things have really changed. This is required because go-git in not properly handling CRLF: https://github.com/go-git/go-git/issues/594

func ListRemoteRefs added in v2.14.0

func ListRemoteRefs(ctx context.Context, url types.GitUrl, sshPool *ssh_pool.SshPool, auth auth2.AuthMethodAndCA) ([]*plumbing.Reference, error)

func ListRemoteRefsFastSsh added in v2.14.0

func ListRemoteRefsFastSsh(ctx context.Context, url types.GitUrl, sshPool *ssh_pool.SshPool, auth auth2.AuthMethodAndCA) ([]*plumbing.Reference, error)

ListRemoteRefsFastSsh will reuse existing ssh connections from a pool

func ListRemoteRefsSlow added in v2.14.0

func ListRemoteRefsSlow(ctx context.Context, url types.GitUrl, auth auth2.AuthMethodAndCA) ([]*plumbing.Reference, error)

func LoadGitignore added in v2.22.0

func LoadGitignore(p string) ([]gitignore.Pattern, error)

func PoorMansClone

func PoorMansClone(sourceDir string, targetDir string, coOptions *git.CheckoutOptions) error

PoorMansCloneCommit poor mans clone from a local repo, which does not rely on go-git using git-upload-pack

Types

type CheckoutInfo added in v2.11.2

type CheckoutInfo struct {
	CheckedOutRef    types.GitRef `json:"checkedOutRef"`
	CheckedOutCommit string       `json:"checkedOutCommit"`
}

type MirroredGitRepo

type MirroredGitRepo struct {
	// contains filtered or unexported fields
}

func NewMirroredGitRepo

func NewMirroredGitRepo(ctx context.Context, u types.GitUrl, baseDir string, sshPool *ssh_pool.SshPool, authProviders *auth2.GitAuthProviders) (*MirroredGitRepo, error)

func (*MirroredGitRepo) CloneProjectByCommit added in v2.13.0

func (g *MirroredGitRepo) CloneProjectByCommit(commit string, targetDir string) error

func (*MirroredGitRepo) DefaultRef

func (g *MirroredGitRepo) DefaultRef() (string, error)

func (*MirroredGitRepo) GetGitTreeByCommit added in v2.13.0

func (g *MirroredGitRepo) GetGitTreeByCommit(commitHash string) (*object.Tree, error)

func (*MirroredGitRepo) GetObjectByHash added in v2.20.5

func (g *MirroredGitRepo) GetObjectByHash(hash string) (object.Object, error)

func (*MirroredGitRepo) HasUpdated

func (g *MirroredGitRepo) HasUpdated() bool

func (*MirroredGitRepo) IsLocked added in v2.11.0

func (g *MirroredGitRepo) IsLocked() bool

func (*MirroredGitRepo) LastUpdateTime added in v2.9.0

func (g *MirroredGitRepo) LastUpdateTime() time.Time

func (*MirroredGitRepo) Lock

func (g *MirroredGitRepo) Lock() error

func (*MirroredGitRepo) RemoteRefHashesMap

func (g *MirroredGitRepo) RemoteRefHashesMap() (map[string]string, error)

func (*MirroredGitRepo) SetUpdated added in v2.9.0

func (g *MirroredGitRepo) SetUpdated(u bool)

func (*MirroredGitRepo) Unlock

func (g *MirroredGitRepo) Unlock() error

func (*MirroredGitRepo) Update

func (g *MirroredGitRepo) Update() error

func (*MirroredGitRepo) Url added in v2.11.2

func (g *MirroredGitRepo) Url() types.GitUrl

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL