Files
bluekeyes-go-gitdiff/gitdiff/gitdiff.go
T
Billy Keyes 2a2f704b96 Add incomplete git header parsing functions
I believe the structure is correct, but there are a lot of details to
fill in - translating the C string parsing logic into Go is not always
straightforward.
2019-03-14 23:09:41 -07:00

34 lines
505 B
Go

package gitdiff
import (
"os"
)
// File describes changes to a single file. It can be either a text file or a
// binary file.
type File struct {
OldName string
NewName string
IsNew bool
IsDelete bool
IsCopy bool
IsRename bool
OldMode os.FileMode
NewMode os.FileMode
Score int
Fragments []*Fragment
}
// Fragment describes changed lines starting at a specific line in a text file.
type Fragment struct {
OldPosition int64
OldLines int64
NewPosition int64
NewLines int64
}