Skip to content

Commit 5b6ce70

Browse files
refactor: Use undeprecated options init (libgit2#656)
This PR move form linking against the deprecated `init_options` functions to the renamed `options_init` functions. For more context see libgit2/libgit2@0b5ba0d and libgit2/libgit2@c6184f0.
1 parent 37b81b6 commit 5b6ce70

File tree

13 files changed

+18
-18
lines changed

13 files changed

+18
-18
lines changed

blame.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func DefaultBlameOptions() (BlameOptions, error) {
2323
defer runtime.UnlockOSThread()
2424

2525
opts := C.git_blame_options{}
26-
ecode := C.git_blame_init_options(&opts, C.GIT_BLAME_OPTIONS_VERSION)
26+
ecode := C.git_blame_options_init(&opts, C.GIT_BLAME_OPTIONS_VERSION)
2727
if ecode < 0 {
2828
return BlameOptions{}, MakeGitError(ecode)
2929
}

checkout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func populateCheckoutOpts(ptr *C.git_checkout_options, opts *CheckoutOpts) *C.gi
134134
return nil
135135
}
136136

137-
C.git_checkout_init_options(ptr, 1)
137+
C.git_checkout_options_init(ptr, 1)
138138
ptr.checkout_strategy = C.uint(opts.Strategy)
139139
ptr.disable_filters = cbool(opts.DisableFilters)
140140
ptr.dir_mode = C.uint(opts.DirMode.Perm())

cherrypick.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func DefaultCherrypickOptions() (CherrypickOptions, error) {
5050
runtime.LockOSThread()
5151
defer runtime.UnlockOSThread()
5252

53-
ecode := C.git_cherrypick_init_options(&c, C.GIT_CHERRYPICK_OPTIONS_VERSION)
53+
ecode := C.git_cherrypick_options_init(&c, C.GIT_CHERRYPICK_OPTIONS_VERSION)
5454
if ecode < 0 {
5555
return CherrypickOptions{}, MakeGitError(ecode)
5656
}

clone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func remoteCreateCallback(cremote unsafe.Pointer, crepo unsafe.Pointer, cname, c
7777
}
7878

7979
func populateCloneOptions(ptr *C.git_clone_options, opts *CloneOptions) {
80-
C.git_clone_init_options(ptr, C.GIT_CLONE_OPTIONS_VERSION)
80+
C.git_clone_options_init(ptr, C.GIT_CLONE_OPTIONS_VERSION)
8181

8282
if opts == nil {
8383
return

describe.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func DefaultDescribeOptions() (DescribeOptions, error) {
4343
defer runtime.UnlockOSThread()
4444

4545
opts := C.git_describe_options{}
46-
ecode := C.git_describe_init_options(&opts, C.GIT_DESCRIBE_OPTIONS_VERSION)
46+
ecode := C.git_describe_options_init(&opts, C.GIT_DESCRIBE_OPTIONS_VERSION)
4747
if ecode < 0 {
4848
return DescribeOptions{}, MakeGitError(ecode)
4949
}
@@ -77,7 +77,7 @@ func DefaultDescribeFormatOptions() (DescribeFormatOptions, error) {
7777
defer runtime.UnlockOSThread()
7878

7979
opts := C.git_describe_format_options{}
80-
ecode := C.git_describe_init_format_options(&opts, C.GIT_DESCRIBE_FORMAT_OPTIONS_VERSION)
80+
ecode := C.git_describe_format_options_init(&opts, C.GIT_DESCRIBE_FORMAT_OPTIONS_VERSION)
8181
if ecode < 0 {
8282
return DescribeFormatOptions{}, MakeGitError(ecode)
8383
}

diff.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ func DefaultDiffOptions() (DiffOptions, error) {
512512
runtime.LockOSThread()
513513
defer runtime.UnlockOSThread()
514514

515-
ecode := C.git_diff_init_options(&opts, C.GIT_DIFF_OPTIONS_VERSION)
515+
ecode := C.git_diff_options_init(&opts, C.GIT_DIFF_OPTIONS_VERSION)
516516
if ecode < 0 {
517517
return DiffOptions{}, MakeGitError(ecode)
518518
}
@@ -567,7 +567,7 @@ func DefaultDiffFindOptions() (DiffFindOptions, error) {
567567
runtime.LockOSThread()
568568
defer runtime.UnlockOSThread()
569569

570-
ecode := C.git_diff_find_init_options(&opts, C.GIT_DIFF_FIND_OPTIONS_VERSION)
570+
ecode := C.git_diff_find_options_init(&opts, C.GIT_DIFF_FIND_OPTIONS_VERSION)
571571
if ecode < 0 {
572572
return DiffFindOptions{}, MakeGitError(ecode)
573573
}

merge.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func DefaultMergeOptions() (MergeOptions, error) {
165165
runtime.LockOSThread()
166166
defer runtime.UnlockOSThread()
167167

168-
ecode := C.git_merge_init_options(&opts, C.GIT_MERGE_OPTIONS_VERSION)
168+
ecode := C.git_merge_options_init(&opts, C.GIT_MERGE_OPTIONS_VERSION)
169169
if ecode < 0 {
170170
return MergeOptions{}, MakeGitError(ecode)
171171
}
@@ -477,7 +477,7 @@ func MergeFile(ancestor MergeFileInput, ours MergeFileInput, theirs MergeFileInp
477477
var copts *C.git_merge_file_options
478478
if options != nil {
479479
copts = &C.git_merge_file_options{}
480-
ecode := C.git_merge_file_init_options(copts, C.GIT_MERGE_FILE_OPTIONS_VERSION)
480+
ecode := C.git_merge_file_options_init(copts, C.GIT_MERGE_FILE_OPTIONS_VERSION)
481481
if ecode < 0 {
482482
return nil, MakeGitError(ecode)
483483
}

rebase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func DefaultRebaseOptions() (RebaseOptions, error) {
140140
runtime.LockOSThread()
141141
defer runtime.UnlockOSThread()
142142

143-
ecode := C.git_rebase_init_options(&opts, C.GIT_REBASE_OPTIONS_VERSION)
143+
ecode := C.git_rebase_options_init(&opts, C.GIT_REBASE_OPTIONS_VERSION)
144144
if ecode < 0 {
145145
return RebaseOptions{}, MakeGitError(ecode)
146146
}

remote.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ func pushUpdateReferenceCallback(refname, status *C.char, data unsafe.Pointer) i
361361
}
362362

363363
func populateProxyOptions(ptr *C.git_proxy_options, opts *ProxyOptions) {
364-
C.git_proxy_init_options(ptr, C.GIT_PROXY_OPTIONS_VERSION)
364+
C.git_proxy_options_init(ptr, C.GIT_PROXY_OPTIONS_VERSION)
365365
if opts == nil {
366366
return
367367
}
@@ -685,7 +685,7 @@ func (o *Remote) RefspecCount() uint {
685685
}
686686

687687
func populateFetchOptions(options *C.git_fetch_options, opts *FetchOptions) {
688-
C.git_fetch_init_options(options, C.GIT_FETCH_OPTIONS_VERSION)
688+
C.git_fetch_options_init(options, C.GIT_FETCH_OPTIONS_VERSION)
689689
if opts == nil {
690690
return
691691
}
@@ -701,7 +701,7 @@ func populateFetchOptions(options *C.git_fetch_options, opts *FetchOptions) {
701701
}
702702

703703
func populatePushOptions(options *C.git_push_options, opts *PushOptions) {
704-
C.git_push_init_options(options, C.GIT_PUSH_OPTIONS_VERSION)
704+
C.git_push_options_init(options, C.GIT_PUSH_OPTIONS_VERSION)
705705
if opts == nil {
706706
return
707707
}

revert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func DefaultRevertOptions() (RevertOptions, error) {
4343
runtime.LockOSThread()
4444
defer runtime.UnlockOSThread()
4545

46-
ecode := C.git_revert_init_options(&opts, C.GIT_REVERT_OPTIONS_VERSION)
46+
ecode := C.git_revert_options_init(&opts, C.GIT_REVERT_OPTIONS_VERSION)
4747
if ecode < 0 {
4848
return RevertOptions{}, MakeGitError(ecode)
4949
}

stash.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func DefaultStashApplyOptions() (StashApplyOptions, error) {
151151
runtime.LockOSThread()
152152
defer runtime.UnlockOSThread()
153153

154-
ecode := C.git_stash_apply_init_options(&optsC, C.GIT_STASH_APPLY_OPTIONS_VERSION)
154+
ecode := C.git_stash_apply_options_init(&optsC, C.GIT_STASH_APPLY_OPTIONS_VERSION)
155155
if ecode < 0 {
156156
return StashApplyOptions{}, MakeGitError(ecode)
157157
}

status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func (v *Repository) StatusList(opts *StatusOptions) (*StatusList, error) {
159159
}
160160
} else {
161161
copts = &C.git_status_options{}
162-
ret := C.git_status_init_options(copts, C.GIT_STATUS_OPTIONS_VERSION)
162+
ret := C.git_status_options_init(copts, C.GIT_STATUS_OPTIONS_VERSION)
163163
if ret < 0 {
164164
return nil, MakeGitError(ret)
165165
}

submodule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ func (sub *Submodule) Update(init bool, opts *SubmoduleUpdateOptions) error {
360360
}
361361

362362
func populateSubmoduleUpdateOptions(ptr *C.git_submodule_update_options, opts *SubmoduleUpdateOptions) error {
363-
C.git_submodule_update_init_options(ptr, C.GIT_SUBMODULE_UPDATE_OPTIONS_VERSION)
363+
C.git_submodule_update_options_init(ptr, C.GIT_SUBMODULE_UPDATE_OPTIONS_VERSION)
364364

365365
if opts == nil {
366366
return nil

0 commit comments

Comments
 (0)