git

package
v0.0.0-...-60d670b Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package git wraps functionality in the go-git package to manipulate Git repositories

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanWorktree

func CleanWorktree(worktree *git.Worktree) error

CleanWorktree runs the equivalent of `git clean -xfd .` on the current worktree

func Open

func Open(path string) (*git.Repository, error)

Open opens a repository on-disk at the given path. All operations from here-on are performed using the on-disk filesystem.

func WalkTree

func WalkTree(fs billy.Filesystem, cb WalkFunc) error

WalkTree will recursively crawl a go-git Worktree and invoke a callback for each file and directory

Types

type IgnorePattern

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

IgnorePattern aliases string to add some additional documentation

func CompileIgnorePattern

func CompileIgnorePattern(pattern string) (*IgnorePattern, error)

CompileIgnorePattern takes a given ignore pattern and attempts to create a Pattern object from it

func (*IgnorePattern) Matches

func (p *IgnorePattern) Matches(path string) bool

Matches returns whether or not a given path matches the Codeowners path pattern

func (*IgnorePattern) String

func (p *IgnorePattern) String() string

type Status

type Status = git.Status

Status is a re-export of go-git Status

type WalkFunc

type WalkFunc func(path string, info os.FileInfo, err error) error

WalkFunc is the callback function signature used by WalkTree

Jump to

Keyboard shortcuts

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