Skip to content

Commit 9b94bb9

Browse files
committed
Prepare for the v1.2.0 release
This change adds a few more deprecation messages just before we remove them.
1 parent df7084d commit 9b94bb9

File tree

3 files changed

+139
-78
lines changed

3 files changed

+139
-78
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Set up Go
4646
uses: actions/setup-go@v1
4747
with:
48-
go-version: '1.15'
48+
go-version: '1.17'
4949
id: go
5050
- name: Check out code into the Go module directory
5151
uses: actions/checkout@v1
@@ -70,7 +70,7 @@ jobs:
7070
- name: Set up Go
7171
uses: actions/setup-go@v1
7272
with:
73-
go-version: '1.15'
73+
go-version: '1.17'
7474
id: go
7575
- name: Check out code into the Go module directory
7676
uses: actions/checkout@v1
@@ -93,7 +93,7 @@ jobs:
9393
- name: Set up Go
9494
uses: actions/setup-go@v1
9595
with:
96-
go-version: '1.15'
96+
go-version: '1.17'
9797
id: go
9898
- name: Check out code into the Go module directory
9999
uses: actions/checkout@v1

deprecated.go

Lines changed: 133 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ import (
1313

1414
// blob.go
1515

16-
// BlobChunkCallback is not used.
16+
// Deprecated: BlobChunkCallback is not used.
1717
type BlobChunkCallback func(maxLen int) ([]byte, error)
1818

19-
// BlobCallbackData is not used.
19+
// Deprecated: BlobCallbackData is not used.
2020
type BlobCallbackData struct {
2121
Callback BlobChunkCallback
2222
Error error
2323
}
2424

2525
// checkout.go
2626

27-
// CheckoutOpts is a deprecated alias of CheckoutOptions.
27+
// Deprecated: CheckoutOpts is a deprecated alias of CheckoutOptions.
2828
type CheckoutOpts = CheckoutOptions
2929

3030
// credentials.go
3131

32-
// CredType is a deprecated alias of CredentialType
32+
// Deprecated: CredType is a deprecated alias of CredentialType
3333
type CredType = CredentialType
3434

3535
const (
@@ -39,127 +39,183 @@ const (
3939
CredTypeDefault = CredentialTypeDefault
4040
)
4141

42-
// Cred is a deprecated alias of Credential
42+
// Deprecated: Cred is a deprecated alias of Credential
4343
type Cred = Credential
4444

45-
// NewCredUsername is a deprecated alias of NewCredentialUsername.
45+
// Deprecated: NewCredUsername is a deprecated alias of NewCredentialUsername.
4646
func NewCredUsername(username string) (*Cred, error) {
4747
return NewCredentialUsername(username)
4848
}
4949

50-
// NewCredUserpassPlaintext is a deprecated alias of NewCredentialUserpassPlaintext.
50+
// Deprecated: NewCredUserpassPlaintext is a deprecated alias of NewCredentialUserpassPlaintext.
5151
func NewCredUserpassPlaintext(username string, password string) (*Cred, error) {
5252
return NewCredentialUserpassPlaintext(username, password)
5353
}
5454

55-
// NewCredSshKey is a deprecated alias of NewCredentialSshKey.
55+
// Deprecated: NewCredSshKey is a deprecated alias of NewCredentialSshKey.
5656
func NewCredSshKey(username string, publicKeyPath string, privateKeyPath string, passphrase string) (*Cred, error) {
5757
return NewCredentialSSHKey(username, publicKeyPath, privateKeyPath, passphrase)
5858
}
5959

60-
// NewCredSshKeyFromMemory is a deprecated alias of NewCredentialSSHKeyFromMemory.
60+
// Deprecated: NewCredSshKeyFromMemory is a deprecated alias of NewCredentialSSHKeyFromMemory.
6161
func NewCredSshKeyFromMemory(username string, publicKey string, privateKey string, passphrase string) (*Cred, error) {
6262
return NewCredentialSSHKeyFromMemory(username, publicKey, privateKey, passphrase)
6363
}
6464

65-
// NewCredSshKeyFromAgent is a deprecated alias of NewCredentialSSHFromAgent.
65+
// Deprecated: NewCredSshKeyFromAgent is a deprecated alias of NewCredentialSSHFromAgent.
6666
func NewCredSshKeyFromAgent(username string) (*Cred, error) {
6767
return NewCredentialSSHKeyFromAgent(username)
6868
}
6969

70-
// NewCredDefault is a deprecated alias fof NewCredentialDefault.
70+
// Deprecated: NewCredDefault is a deprecated alias fof NewCredentialDefault.
7171
func NewCredDefault() (*Cred, error) {
7272
return NewCredentialDefault()
7373
}
7474

7575
// features.go
7676

7777
const (
78-
// FeatureHttps is a deprecated alias of FeatureHTTPS.
78+
// Deprecated: FeatureHttps is a deprecated alias of FeatureHTTPS.
7979
FeatureHttps = FeatureHTTPS
8080

81-
// FeatureSsh is a deprecated alias of FeatureSSH.
81+
// Deprecated: FeatureSsh is a deprecated alias of FeatureSSH.
8282
FeatureSsh = FeatureSSH
8383
)
8484

8585
// git.go
8686

8787
const (
88-
ErrClassNone = ErrorClassNone
89-
ErrClassNoMemory = ErrorClassNoMemory
90-
ErrClassOs = ErrorClassOS
91-
ErrClassInvalid = ErrorClassInvalid
92-
ErrClassReference = ErrorClassReference
93-
ErrClassZlib = ErrorClassZlib
88+
// Deprecated: ErrClassNone is a deprecated alias of ErrorClassNone.
89+
ErrClassNone = ErrorClassNone
90+
// Deprecated: ErrClassNoMemory is a deprecated alias of ErrorClassNoMemory.
91+
ErrClassNoMemory = ErrorClassNoMemory
92+
// Deprecated: ErrClassOs is a deprecated alias of ErrorClassOS.
93+
ErrClassOs = ErrorClassOS
94+
// Deprecated: ErrClassInvalid is a deprecated alias of ErrorClassInvalid.
95+
ErrClassInvalid = ErrorClassInvalid
96+
// Deprecated: ErrClassReference is a deprecated alias of ErrorClassReference.
97+
ErrClassReference = ErrorClassReference
98+
// Deprecated: ErrClassZlib is a deprecated alias of ErrorClassZlib.
99+
ErrClassZlib = ErrorClassZlib
100+
// Deprecated: ErrClassRepository is a deprecated alias of ErrorClassRepository.
94101
ErrClassRepository = ErrorClassRepository
95-
ErrClassConfig = ErrorClassConfig
96-
ErrClassRegex = ErrorClassRegex
97-
ErrClassOdb = ErrorClassOdb
98-
ErrClassIndex = ErrorClassIndex
99-
ErrClassObject = ErrorClassObject
100-
ErrClassNet = ErrorClassNet
101-
ErrClassTag = ErrorClassTag
102-
ErrClassTree = ErrorClassTree
103-
ErrClassIndexer = ErrorClassIndexer
104-
ErrClassSSL = ErrorClassSSL
105-
ErrClassSubmodule = ErrorClassSubmodule
106-
ErrClassThread = ErrorClassThread
107-
ErrClassStash = ErrorClassStash
108-
ErrClassCheckout = ErrorClassCheckout
109-
ErrClassFetchHead = ErrorClassFetchHead
110-
ErrClassMerge = ErrorClassMerge
111-
ErrClassSsh = ErrorClassSSH
112-
ErrClassFilter = ErrorClassFilter
113-
ErrClassRevert = ErrorClassRevert
114-
ErrClassCallback = ErrorClassCallback
115-
ErrClassRebase = ErrorClassRebase
116-
ErrClassPatch = ErrorClassPatch
102+
// Deprecated: ErrClassConfig is a deprecated alias of ErrorClassConfig.
103+
ErrClassConfig = ErrorClassConfig
104+
// Deprecated: ErrClassRegex is a deprecated alias of ErrorClassRegex.
105+
ErrClassRegex = ErrorClassRegex
106+
// Deprecated: ErrClassOdb is a deprecated alias of ErrorClassOdb.
107+
ErrClassOdb = ErrorClassOdb
108+
// Deprecated: ErrClassIndex is a deprecated alias of ErrorClassIndex.
109+
ErrClassIndex = ErrorClassIndex
110+
// Deprecated: ErrClassObject is a deprecated alias of ErrorClassObject.
111+
ErrClassObject = ErrorClassObject
112+
// Deprecated: ErrClassNet is a deprecated alias of ErrorClassNet.
113+
ErrClassNet = ErrorClassNet
114+
// Deprecated: ErrClassTag is a deprecated alias of ErrorClassTag.
115+
ErrClassTag = ErrorClassTag
116+
// Deprecated: ErrClassTree is a deprecated alias of ErrorClassTree.
117+
ErrClassTree = ErrorClassTree
118+
// Deprecated: ErrClassIndexer is a deprecated alias of ErrorClassIndexer.
119+
ErrClassIndexer = ErrorClassIndexer
120+
// Deprecated: ErrClassSSL is a deprecated alias of ErrorClassSSL.
121+
ErrClassSSL = ErrorClassSSL
122+
// Deprecated: ErrClassSubmodule is a deprecated alias of ErrorClassSubmodule.
123+
ErrClassSubmodule = ErrorClassSubmodule
124+
// Deprecated: ErrClassThread is a deprecated alias of ErrorClassThread.
125+
ErrClassThread = ErrorClassThread
126+
// Deprecated: ErrClassStash is a deprecated alias of ErrorClassStash.
127+
ErrClassStash = ErrorClassStash
128+
// Deprecated: ErrClassCheckout is a deprecated alias of ErrorClassCheckout.
129+
ErrClassCheckout = ErrorClassCheckout
130+
// Deprecated: ErrClassFetchHead is a deprecated alias of ErrorClassFetchHead.
131+
ErrClassFetchHead = ErrorClassFetchHead
132+
// Deprecated: ErrClassMerge is a deprecated alias of ErrorClassMerge.
133+
ErrClassMerge = ErrorClassMerge
134+
// Deprecated: ErrClassSsh is a deprecated alias of ErrorClassSSH.
135+
ErrClassSsh = ErrorClassSSH
136+
// Deprecated: ErrClassFilter is a deprecated alias of ErrorClassFilter.
137+
ErrClassFilter = ErrorClassFilter
138+
// Deprecated: ErrClassRevert is a deprecated alias of ErrorClassRevert.
139+
ErrClassRevert = ErrorClassRevert
140+
// Deprecated: ErrClassCallback is a deprecated alias of ErrorClassCallback.
141+
ErrClassCallback = ErrorClassCallback
142+
// Deprecated: ErrClassRebase is a deprecated alias of ErrorClassRebase.
143+
ErrClassRebase = ErrorClassRebase
144+
// Deprecated: ErrClassPatch is a deprecated alias of ErrorClassPatch.
145+
ErrClassPatch = ErrorClassPatch
117146
)
118147

119148
const (
120-
ErrOk = ErrorCodeOK
121-
ErrGeneric = ErrorCodeGeneric
122-
ErrNotFound = ErrorCodeNotFound
123-
ErrExists = ErrorCodeExists
124-
ErrAmbiguous = ErrorCodeAmbiguous
125-
ErrAmbigious = ErrorCodeAmbiguous
126-
ErrBuffs = ErrorCodeBuffs
127-
ErrUser = ErrorCodeUser
128-
ErrBareRepo = ErrorCodeBareRepo
129-
ErrUnbornBranch = ErrorCodeUnbornBranch
130-
ErrUnmerged = ErrorCodeUnmerged
149+
// Deprecated: ErrOk is a deprecated alias of ErrorCodeOK.
150+
ErrOk = ErrorCodeOK
151+
// Deprecated: ErrGeneric is a deprecated alias of ErrorCodeGeneric.
152+
ErrGeneric = ErrorCodeGeneric
153+
// Deprecated: ErrNotFound is a deprecated alias of ErrorCodeNotFound.
154+
ErrNotFound = ErrorCodeNotFound
155+
// Deprecated: ErrExists is a deprecated alias of ErrorCodeExists.
156+
ErrExists = ErrorCodeExists
157+
// Deprecated: ErrAmbiguous is a deprecated alias of ErrorCodeAmbiguous.
158+
ErrAmbiguous = ErrorCodeAmbiguous
159+
// Deprecated: ErrAmbigious is a deprecated alias of ErrorCodeAmbiguous.
160+
ErrAmbigious = ErrorCodeAmbiguous
161+
// Deprecated: ErrBuffs is a deprecated alias of ErrorCodeBuffs.
162+
ErrBuffs = ErrorCodeBuffs
163+
// Deprecated: ErrUser is a deprecated alias of ErrorCodeUser.
164+
ErrUser = ErrorCodeUser
165+
// Deprecated: ErrBareRepo is a deprecated alias of ErrorCodeBareRepo.
166+
ErrBareRepo = ErrorCodeBareRepo
167+
// Deprecated: ErrUnbornBranch is a deprecated alias of ErrorCodeUnbornBranch.
168+
ErrUnbornBranch = ErrorCodeUnbornBranch
169+
// Deprecated: ErrUnmerged is a deprecated alias of ErrorCodeUnmerged.
170+
ErrUnmerged = ErrorCodeUnmerged
171+
// Deprecated: ErrNonFastForward is a deprecated alias of ErrorCodeNonFastForward.
131172
ErrNonFastForward = ErrorCodeNonFastForward
132-
ErrInvalidSpec = ErrorCodeInvalidSpec
133-
ErrConflict = ErrorCodeConflict
134-
ErrLocked = ErrorCodeLocked
135-
ErrModified = ErrorCodeModified
136-
ErrAuth = ErrorCodeAuth
137-
ErrCertificate = ErrorCodeCertificate
138-
ErrApplied = ErrorCodeApplied
139-
ErrPeel = ErrorCodePeel
140-
ErrEOF = ErrorCodeEOF
141-
ErrUncommitted = ErrorCodeUncommitted
142-
ErrDirectory = ErrorCodeDirectory
143-
ErrMergeConflict = ErrorCodeMergeConflict
144-
ErrPassthrough = ErrorCodePassthrough
145-
ErrIterOver = ErrorCodeIterOver
146-
ErrApplyFail = ErrorCodeApplyFail
173+
// Deprecated: ErrInvalidSpec is a deprecated alias of ErrorCodeInvalidSpec.
174+
ErrInvalidSpec = ErrorCodeInvalidSpec
175+
// Deprecated: ErrConflict is a deprecated alias of ErrorCodeConflict.
176+
ErrConflict = ErrorCodeConflict
177+
// Deprecated: ErrLocked is a deprecated alias of ErrorCodeLocked.
178+
ErrLocked = ErrorCodeLocked
179+
// Deprecated: ErrModified is a deprecated alias of ErrorCodeModified.
180+
ErrModified = ErrorCodeModified
181+
// Deprecated: ErrAuth is a deprecated alias of ErrorCodeAuth.
182+
ErrAuth = ErrorCodeAuth
183+
// Deprecated: ErrCertificate is a deprecated alias of ErrorCodeCertificate.
184+
ErrCertificate = ErrorCodeCertificate
185+
// Deprecated: ErrApplied is a deprecated alias of ErrorCodeApplied.
186+
ErrApplied = ErrorCodeApplied
187+
// Deprecated: ErrPeel is a deprecated alias of ErrorCodePeel.
188+
ErrPeel = ErrorCodePeel
189+
// Deprecated: ErrEOF is a deprecated alias of ErrorCodeEOF.
190+
ErrEOF = ErrorCodeEOF
191+
// Deprecated: ErrUncommitted is a deprecated alias of ErrorCodeUncommitted.
192+
ErrUncommitted = ErrorCodeUncommitted
193+
// Deprecated: ErrDirectory is a deprecated alias of ErrorCodeDirectory.
194+
ErrDirectory = ErrorCodeDirectory
195+
// Deprecated: ErrMergeConflict is a deprecated alias of ErrorCodeMergeConflict.
196+
ErrMergeConflict = ErrorCodeMergeConflict
197+
// Deprecated: ErrPassthrough is a deprecated alias of ErrorCodePassthrough.
198+
ErrPassthrough = ErrorCodePassthrough
199+
// Deprecated: ErrIterOver is a deprecated alias of ErrorCodeIterOver.
200+
ErrIterOver = ErrorCodeIterOver
201+
// Deprecated: ErrApplyFail is a deprecated alias of ErrorCodeApplyFail.
202+
ErrApplyFail = ErrorCodeApplyFail
147203
)
148204

149205
// index.go
150206

151-
// IndexAddOpts is a deprecated alias of IndexAddOption.
207+
// Deprecated: IndexAddOpts is a deprecated alias of IndexAddOption.
152208
type IndexAddOpts = IndexAddOption
153209

154-
// IndexStageOpts is a deprecated alias of IndexStageState.
210+
// Deprecated: IndexStageOpts is a deprecated alias of IndexStageState.
155211
type IndexStageOpts = IndexStageState
156212

157213
// submodule.go
158214

159-
// SubmoduleCbk is a deprecated alias of SubmoduleCallback.
215+
// Deprecated: SubmoduleCbk is a deprecated alias of SubmoduleCallback.
160216
type SubmoduleCbk = SubmoduleCallback
161217

162-
// SubmoduleVisitor is not used.
218+
// Deprecated: SubmoduleVisitor is not used.
163219
func SubmoduleVisitor(csub unsafe.Pointer, name *C.char, handle unsafe.Pointer) C.int {
164220
sub := &Submodule{(*C.git_submodule)(csub), nil}
165221

@@ -170,9 +226,14 @@ func SubmoduleVisitor(csub unsafe.Pointer, name *C.char, handle unsafe.Pointer)
170226
return (C.int)(callback(sub, C.GoString(name)))
171227
}
172228

229+
// reference.go
230+
231+
// Deprecated: ReferenceIsValidName is a deprecated alias of ReferenceNameIsValid.
232+
var ReferenceIsValidName = ReferenceNameIsValid
233+
173234
// tree.go
174235

175-
// CallbackGitTreeWalk is not used.
236+
// Deprecated: CallbackGitTreeWalk is not used.
176237
func CallbackGitTreeWalk(_root *C.char, entry *C.git_tree_entry, ptr unsafe.Pointer) C.int {
177238
root := C.GoString(_root)
178239

reference.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ func (v *ReferenceIterator) Free() {
472472
C.git_reference_iterator_free(v.ptr)
473473
}
474474

475-
// ReferenceIsValidName returns whether the reference name is well-formed.
475+
// ReferenceNameIsValid returns whether the reference name is well-formed.
476476
//
477477
// Valid reference names must follow one of two patterns:
478478
//
@@ -482,11 +482,11 @@ func (v *ReferenceIterator) Free() {
482482
// 2. Names prefixed with "refs/" can be almost anything. You must avoid
483483
// the characters '~', '^', ':', ' \ ', '?', '[', and '*', and the sequences
484484
// ".." and " @ {" which have special meaning to revparse.
485-
func ReferenceIsValidName(name string) bool {
485+
func ReferenceNameIsValid(name string) bool {
486486
cname := C.CString(name)
487487
defer C.free(unsafe.Pointer(cname))
488488

489-
return C.git_reference_is_valid_name(cname) == 1
489+
return C.git_reference_name_is_valid(cname) == 1
490490
}
491491

492492
const (

0 commit comments

Comments
 (0)