Documentation ¶
Index ¶
- Constants
- Variables
- 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 Options
- type PatchDescriptor
- type PatchOptions
- type PathFilter
Constants ¶
View Source
const ( MinGitVersionConstraint = "1.9.0" MinGitVersionWithSubmodulesConstraint = "2.14.0" )
Variables ¶
View Source
var ( GitVersion string RequiredGitVersionMsg = fmt.Sprintf("Git version >= %s required! To use submodules install git >= %s.", MinGitVersionConstraint, MinGitVersionWithSubmodulesConstraint) )
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 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.