diff options
| author | lhchavez <[email protected]> | 2020-12-05 07:23:44 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-05 07:23:44 -0800 |
| commit | 137c05e802d5e11a5ab54809bc8be8f61ccece21 (patch) | |
| tree | b44997824565f9506744a4259177746b83112e92 /clone.go | |
| parent | 1fabe95fb7275df980ff6ab03fb85eac91c5849d (diff) | |
Mark some symbols to be deprecated #minor (#698)
This change introduces the file deprecated.go, which contains any
constants, functions, and types that are slated to be deprecated in the
next major release.
These symbols are deprecated because they refer to old spellings in
pre-1.0 libgit2. This also makes the build be done with the
`-DDEPRECATE_HARD` flag to avoid regressions.
This, together with
[gorelease](https://godoc.org/golang.org/x/exp/cmd/gorelease)[1] should
make releases safer going forward.
1: More information about how that works at
https://go.googlesource.com/exp/+/refs/heads/master/apidiff/README.md
Diffstat (limited to 'clone.go')
| -rw-r--r-- | clone.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -58,19 +58,19 @@ func remoteCreateCallback(cremote unsafe.Pointer, crepo unsafe.Pointer, cname, c runtime.SetFinalizer(repo, nil) if opts, ok := pointerHandles.Get(payload).(CloneOptions); ok { - remote, err := opts.RemoteCreateCallback(repo, name, url) + remote, errorCode := opts.RemoteCreateCallback(repo, name, url) // clear finalizer as the calling C function will // free the remote itself runtime.SetFinalizer(remote, nil) - if err == ErrOk && remote != nil { + if errorCode == ErrorCodeOK && remote != nil { cptr := (**C.git_remote)(cremote) *cptr = remote.ptr - } else if err == ErrOk && remote == nil { + } else if errorCode == ErrorCodeOK && remote == nil { panic("no remote created by callback") } - return C.int(err) + return C.int(errorCode) } else { panic("invalid remote create callback") } @@ -82,7 +82,7 @@ func populateCloneOptions(ptr *C.git_clone_options, opts *CloneOptions) { if opts == nil { return } - populateCheckoutOpts(&ptr.checkout_opts, opts.CheckoutOpts) + populateCheckoutOptions(&ptr.checkout_opts, opts.CheckoutOpts) populateFetchOptions(&ptr.fetch_opts, opts.FetchOptions) ptr.bare = cbool(opts.Bare) @@ -98,7 +98,7 @@ func freeCloneOptions(ptr *C.git_clone_options) { return } - freeCheckoutOpts(&ptr.checkout_opts) + freeCheckoutOptions(&ptr.checkout_opts) if ptr.remote_cb_payload != nil { pointerHandles.Untrack(ptr.remote_cb_payload) |
