Upgrade to libgit2 to 0f9d15493d5d8ad4353dd7beed52c9567334f6e5
This commit is contained in:
parent
6d6736b2bd
commit
aa59dccea7
6
blame.go
6
blame.go
|
@ -58,8 +58,8 @@ func (v *Repository) BlameFile(path string, opts *BlameOptions) (*Blame, error)
|
||||||
version: C.GIT_BLAME_OPTIONS_VERSION,
|
version: C.GIT_BLAME_OPTIONS_VERSION,
|
||||||
flags: C.uint32_t(opts.Flags),
|
flags: C.uint32_t(opts.Flags),
|
||||||
min_match_characters: C.uint16_t(opts.MinMatchCharacters),
|
min_match_characters: C.uint16_t(opts.MinMatchCharacters),
|
||||||
min_line: C.uint32_t(opts.MinLine),
|
min_line: C.size_t(opts.MinLine),
|
||||||
max_line: C.uint32_t(opts.MaxLine),
|
max_line: C.size_t(opts.MaxLine),
|
||||||
}
|
}
|
||||||
if opts.NewestCommit != nil {
|
if opts.NewestCommit != nil {
|
||||||
copts.newest_commit = *opts.NewestCommit.toC()
|
copts.newest_commit = *opts.NewestCommit.toC()
|
||||||
|
@ -100,7 +100,7 @@ func (blame *Blame) HunkByIndex(index int) (BlameHunk, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (blame *Blame) HunkByLine(lineno int) (BlameHunk, error) {
|
func (blame *Blame) HunkByLine(lineno int) (BlameHunk, error) {
|
||||||
ptr := C.git_blame_get_hunk_byline(blame.ptr, C.uint32_t(lineno))
|
ptr := C.git_blame_get_hunk_byline(blame.ptr, C.size_t(lineno))
|
||||||
if ptr == nil {
|
if ptr == nil {
|
||||||
return BlameHunk{}, ErrInvalid
|
return BlameHunk{}, ErrInvalid
|
||||||
}
|
}
|
||||||
|
|
6
diff.go
6
diff.go
|
@ -550,7 +550,7 @@ func diffOptionsToC(opts *DiffOptions) (copts *C.git_diff_options, notifyData *d
|
||||||
|
|
||||||
if opts.NotifyCallback != nil {
|
if opts.NotifyCallback != nil {
|
||||||
C._go_git_setup_diff_notify_callbacks(copts)
|
C._go_git_setup_diff_notify_callbacks(copts)
|
||||||
copts.notify_payload = pointerHandles.Track(notifyData)
|
copts.payload = pointerHandles.Track(notifyData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -562,8 +562,8 @@ func freeDiffOptions(copts *C.git_diff_options) {
|
||||||
freeStrarray(&cpathspec)
|
freeStrarray(&cpathspec)
|
||||||
C.free(unsafe.Pointer(copts.old_prefix))
|
C.free(unsafe.Pointer(copts.old_prefix))
|
||||||
C.free(unsafe.Pointer(copts.new_prefix))
|
C.free(unsafe.Pointer(copts.new_prefix))
|
||||||
if copts.notify_payload != nil {
|
if copts.payload != nil {
|
||||||
pointerHandles.Untrack(copts.notify_payload)
|
pointerHandles.Untrack(copts.payload)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
merge.go
10
merge.go
|
@ -84,11 +84,11 @@ const (
|
||||||
// Detect renames that occur between the common ancestor and the "ours"
|
// Detect renames that occur between the common ancestor and the "ours"
|
||||||
// side or the common ancestor and the "theirs" side. This will enable
|
// side or the common ancestor and the "theirs" side. This will enable
|
||||||
// the ability to merge between a modified and renamed file.
|
// the ability to merge between a modified and renamed file.
|
||||||
MergeTreeFindRenames MergeTreeFlag = C.GIT_MERGE_TREE_FIND_RENAMES
|
MergeTreeFindRenames MergeTreeFlag = C.GIT_MERGE_FIND_RENAMES
|
||||||
// If a conflict occurs, exit immediately instead of attempting to
|
// If a conflict occurs, exit immediately instead of attempting to
|
||||||
// continue resolving conflicts. The merge operation will fail with
|
// continue resolving conflicts. The merge operation will fail with
|
||||||
// GIT_EMERGECONFLICT and no index will be returned.
|
// GIT_EMERGECONFLICT and no index will be returned.
|
||||||
MergeTreeFailOnConflict MergeTreeFlag = C.GIT_MERGE_TREE_FAIL_ON_CONFLICT
|
MergeTreeFailOnConflict MergeTreeFlag = C.GIT_MERGE_FAIL_ON_CONFLICT
|
||||||
)
|
)
|
||||||
|
|
||||||
type MergeOptions struct {
|
type MergeOptions struct {
|
||||||
|
@ -105,7 +105,7 @@ type MergeOptions struct {
|
||||||
func mergeOptionsFromC(opts *C.git_merge_options) MergeOptions {
|
func mergeOptionsFromC(opts *C.git_merge_options) MergeOptions {
|
||||||
return MergeOptions{
|
return MergeOptions{
|
||||||
Version: uint(opts.version),
|
Version: uint(opts.version),
|
||||||
TreeFlags: MergeTreeFlag(opts.tree_flags),
|
TreeFlags: MergeTreeFlag(opts.flags),
|
||||||
RenameThreshold: uint(opts.rename_threshold),
|
RenameThreshold: uint(opts.rename_threshold),
|
||||||
TargetLimit: uint(opts.target_limit),
|
TargetLimit: uint(opts.target_limit),
|
||||||
FileFavor: MergeFileFavor(opts.file_favor),
|
FileFavor: MergeFileFavor(opts.file_favor),
|
||||||
|
@ -131,7 +131,7 @@ func (mo *MergeOptions) toC() *C.git_merge_options {
|
||||||
}
|
}
|
||||||
return &C.git_merge_options{
|
return &C.git_merge_options{
|
||||||
version: C.uint(mo.Version),
|
version: C.uint(mo.Version),
|
||||||
tree_flags: C.git_merge_tree_flag_t(mo.TreeFlags),
|
flags: C.git_merge_flag_t(mo.TreeFlags),
|
||||||
rename_threshold: C.uint(mo.RenameThreshold),
|
rename_threshold: C.uint(mo.RenameThreshold),
|
||||||
target_limit: C.uint(mo.TargetLimit),
|
target_limit: C.uint(mo.TargetLimit),
|
||||||
file_favor: C.git_merge_file_favor_t(mo.FileFavor),
|
file_favor: C.git_merge_file_favor_t(mo.FileFavor),
|
||||||
|
@ -374,7 +374,7 @@ func populateCMergeFileOptions(c *C.git_merge_file_options, options MergeFileOpt
|
||||||
c.our_label = C.CString(options.OurLabel)
|
c.our_label = C.CString(options.OurLabel)
|
||||||
c.their_label = C.CString(options.TheirLabel)
|
c.their_label = C.CString(options.TheirLabel)
|
||||||
c.favor = C.git_merge_file_favor_t(options.Favor)
|
c.favor = C.git_merge_file_favor_t(options.Favor)
|
||||||
c.flags = C.uint(options.Flags)
|
c.flags = C.git_merge_file_flag_t(options.Flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
func freeCMergeFileOptions(c *C.git_merge_file_options) {
|
func freeCMergeFileOptions(c *C.git_merge_file_options) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 821131fdaee74526d84aaf1c6ceddc2139c551df
|
Subproject commit 0f9d15493d5d8ad4353dd7beed52c9567334f6e5
|
Loading…
Reference in New Issue