Documentation ¶
Index ¶
- Constants
- func Fetch(gitDir, from, to string) error
- func GetTreeSHA1(catter *ObjectCatter, commitSHA1 string) (string, error)
- func LineRangesIntersect(elem LineRange, list []LineRange) bool
- func MergeBase(gitDir string, one, two string) (res string, err error)
- func UntrackedFiles(gitDir string) ([]string, error)
- type BlameResult
- type Change
- type ChangeType
- type Commit
- type LineRange
- type Object
- type ObjectCatter
Constants ¶
View Source
const ( CommitHashLen = 40 Zero = "0000000000000000000000000000000000000000" )
Variables ¶
This section is empty.
Functions ¶
func GetTreeSHA1 ¶
func GetTreeSHA1(catter *ObjectCatter, commitSHA1 string) (string, error)
GetTreeSHA1 returns SHA1 of tree object for the commit
func LineRangesIntersect ¶
LineRangesIntersect checks if provided elem line range intersects and of provided ranges from the list.
func UntrackedFiles ¶
UntrackedFiles returns filenames of untracked files obtained with git ls-files command.
Types ¶
type BlameResult ¶
BlameResult is the result of git blame operation
type Change ¶
type Change struct { Type ChangeType OldName, NewName string OldLineRanges, LineRanges []LineRange Valid bool }
Change describes what happened to the file
type ChangeType ¶
type ChangeType int
ChangeType describes what happened to the file: it has been deleted, modified, etc.
const ( Deleted ChangeType = iota Added Changed )
func (ChangeType) String ¶
func (c ChangeType) String() string
type ObjectCatter ¶
type ObjectCatter struct {
// contains filtered or unexported fields
}
ObjectCatter is used to get objects from git, fast
func NewCatter ¶
func NewCatter(gitDir string) (*ObjectCatter, error)
NewCatter spawns git so that we can do "cat-file" for objects pretty fast.
func (*ObjectCatter) Error ¶
func (o *ObjectCatter) Error() error
Click to show internal directories.
Click to hide internal directories.