Documentation ¶
Index ¶
- Constants
- func Init(opts Options) error
- func IsFileInBasePath(filePath, basePath string) bool
- func IsFilePathMatchesOneOfPatterns(filePath string, patterns []string) bool
- func IsFilePathMatchesPattern(filePath, pattern string) bool
- func IsFilePathValid(filePath, basePath string, includePaths, excludePaths []string) bool
- func NormalizeAbsolutePath(path string) string
- func NormalizeDirectoryPrefix(directoryPrefix string) string
- func PrepareWorkTree(gitDir, workTreeDir string, commit string) error
- func PrepareWorkTreeWithSubmodules(gitDir, workTreeDir string, commit string) error
- func TrimFileBasePath(filePath, basePath string) string
- type ArchiveDescriptor
- type ArchiveOptions
- type ArchiveType
- type FsckOptions
- type FsckResult
- type Options
- type PatchDescriptor
- type PatchOptions
- type PathFilter
Constants ¶
View Source
const ( MinGitVersionConstraintValue = "1.9" MinGitVersionWithSubmodulesConstraintValue = "2.14" )
Variables ¶
This section is empty.
Functions ¶
func IsFileInBasePath ¶
* basePath can be path to a directory or a file.
func IsFilePathValid ¶
func NormalizeAbsolutePath ¶
func PrepareWorkTree ¶
func TrimFileBasePath ¶
Types ¶
type ArchiveDescriptor ¶
type ArchiveDescriptor struct { Type ArchiveType IsEmpty bool }
func Archive ¶
func Archive(out io.Writer, gitDir, workTreeDir string, opts ArchiveOptions) (*ArchiveDescriptor, error)
func ArchiveWithSubmodules ¶
func ArchiveWithSubmodules(out io.Writer, gitDir, workTreeDir string, opts ArchiveOptions) (*ArchiveDescriptor, error)
type ArchiveOptions ¶
type ArchiveOptions struct { Commit string PathFilter PathFilter }
type ArchiveType ¶
type ArchiveType string
const ( FileArchive ArchiveType = "file" DirectoryArchive ArchiveType = "directory" )
type FsckOptions ¶
type FsckResult ¶
type FsckResult struct {
UnreachableCommits []string
}
func Fsck ¶
func Fsck(repoDir string, opts FsckOptions) (FsckResult, error)
Fsck gives 'git fsck' output result
type PatchDescriptor ¶
func Patch ¶
func Patch(out io.Writer, gitDir string, opts PatchOptions) (*PatchDescriptor, error)
func PatchWithSubmodules ¶
func PatchWithSubmodules(out io.Writer, gitDir, workTreeDir string, opts PatchOptions) (*PatchDescriptor, error)
type PatchOptions ¶
type PatchOptions struct {
FromCommit, ToCommit string
PathFilter PathFilter
WithEntireFileContext bool
WithBinary bool
}
type PathFilter ¶
type PathFilter struct { // BasePath can be path to the directory or a single file BasePath string IncludePaths, ExcludePaths []string }
func (*PathFilter) IsFilePathValid ¶
func (f *PathFilter) IsFilePathValid(filePath string) bool
func (*PathFilter) String ¶
func (f *PathFilter) String() string
func (*PathFilter) TrimFileBasePath ¶
func (f *PathFilter) TrimFileBasePath(filePath string) string
Click to show internal directories.
Click to hide internal directories.