true_git

package
v1.1.21-fix27 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinGitVersionConstraintValue               = "1.9"
	MinGitVersionWithSubmodulesConstraintValue = "2.14"
)

Variables

View Source
var (
	ForbiddenGitVersionsConstraintValues = []string{"2.22.0"}
)

Functions

func CreateDetachedMergeCommit

func CreateDetachedMergeCommit(gitDir, workTreeCacheDir, commitToMerge, mergeIntoCommit string, opts CreateDetachedMergeCommitOptions) (string, error)

func Fetch

func Fetch(path string, options FetchOptions) error

func GetRealRepoDir

func GetRealRepoDir(repoDir string) (string, error)

func GitOpenWithCustomWorktreeDir

func GitOpenWithCustomWorktreeDir(gitDir, worktreeDir string) (*git.Repository, error)

func Init

func Init(opts Options) error

func IsAncestor

func IsAncestor(ancestorCommit, descendantCommit string, gitDir string) (bool, error)

func IsShallowClone

func IsShallowClone(path string) (bool, error)

func WithWorkTree

func WithWorkTree(gitDir, workTreeCacheDir string, commit string, opts WithWorkTreeOptions, f func(workTreeDir string) error) error

Types

type ArchiveDescriptor

type ArchiveDescriptor struct {
	Type    ArchiveType
	IsEmpty bool
}

func Archive

func Archive(out io.Writer, gitDir, workTreeCacheDir string, opts ArchiveOptions) (*ArchiveDescriptor, error)

func ArchiveWithSubmodules

func ArchiveWithSubmodules(out io.Writer, gitDir, workTreeCacheDir string, opts ArchiveOptions) (*ArchiveDescriptor, error)

type ArchiveOptions

type ArchiveOptions struct {
	Commit      string
	PathMatcher path_matcher.PathMatcher
}

type ArchiveType

type ArchiveType string
const (
	FileArchive      ArchiveType = "file"
	DirectoryArchive ArchiveType = "directory"
)

type CreateDetachedMergeCommitOptions

type CreateDetachedMergeCommitOptions struct {
	HasSubmodules bool
}

type FetchOptions

type FetchOptions struct {
	All       bool
	TagsOnly  bool
	Prune     bool
	PruneTags bool
	Unshallow bool
	RefSpecs  map[string]string
}

type Options

type Options struct {
	Out, Err      io.Writer
	LiveGitOutput bool
}

type PatchDescriptor

type PatchDescriptor struct {
	Paths       []string
	BinaryPaths []string
}

func Patch

func Patch(out io.Writer, gitDir string, opts PatchOptions) (*PatchDescriptor, error)

func PatchWithSubmodules

func PatchWithSubmodules(out io.Writer, gitDir, workTreeCacheDir string, opts PatchOptions) (*PatchDescriptor, error)

type PatchOptions

type PatchOptions struct {
	FromCommit, ToCommit string
	PathMatcher          path_matcher.PathMatcher

	WithEntireFileContext bool
	WithBinary            bool
}

type RefDescriptor

type RefDescriptor struct {
	Commit   string
	FullName string
	IsHEAD   bool

	IsTag   bool
	TagName string

	IsBranch   bool
	BranchName string
	IsRemote   bool
	RemoteName string
}

type ShowRefResult

type ShowRefResult struct {
	Refs []RefDescriptor
}

func ShowRef

func ShowRef(repoDir string) (*ShowRefResult, error)

type WithWorkTreeOptions

type WithWorkTreeOptions struct {
	HasSubmodules bool
}

type WorktreeDescriptor

type WorktreeDescriptor struct {
	Path   string
	Head   string
	Branch string
}

func GetWorkTreeList

func GetWorkTreeList(repoDir string) ([]WorktreeDescriptor, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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