mirror of
https://github.com/bluekeyes/go-gitdiff
synced 2026-06-08 13:18:30 +00:00
aa3e0d357e
The parsed OIDs are usually prefixes, not full hashes, so rename the fields appropriately. Also note that values that are too long to be valid OIDs are still accepted by the library.
36 lines
554 B
Go
36 lines
554 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
|
|
|
|
OldOIDPrefix string
|
|
NewOIDPrefix string
|
|
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
|
|
}
|