|
1 | 1 | package git |
2 | 2 |
|
3 | | -/* |
4 | | -#include <git2.h> |
5 | | -*/ |
6 | | -import "C" |
7 | | -import ( |
8 | | - "unsafe" |
9 | | -) |
10 | | - |
11 | 3 | // The constants, functions, and types in this files are slated for deprecation |
12 | 4 | // in the next major version. |
13 | | - |
14 | | -// blob.go |
15 | | - |
16 | | -// Deprecated: BlobChunkCallback is not used. |
17 | | -type BlobChunkCallback func(maxLen int) ([]byte, error) |
18 | | - |
19 | | -// Deprecated: BlobCallbackData is not used. |
20 | | -type BlobCallbackData struct { |
21 | | - Callback BlobChunkCallback |
22 | | - Error error |
23 | | -} |
24 | | - |
25 | | -// checkout.go |
26 | | - |
27 | | -// Deprecated: CheckoutOpts is a deprecated alias of CheckoutOptions. |
28 | | -type CheckoutOpts = CheckoutOptions |
29 | | - |
30 | | -// credentials.go |
31 | | - |
32 | | -// Deprecated: CredType is a deprecated alias of CredentialType |
33 | | -type CredType = CredentialType |
34 | | - |
35 | | -const ( |
36 | | - CredTypeUserpassPlaintext = CredentialTypeUserpassPlaintext |
37 | | - CredTypeSshKey = CredentialTypeSSHKey |
38 | | - CredTypeSshCustom = CredentialTypeSSHCustom |
39 | | - CredTypeDefault = CredentialTypeDefault |
40 | | -) |
41 | | - |
42 | | -// Deprecated: Cred is a deprecated alias of Credential |
43 | | -type Cred = Credential |
44 | | - |
45 | | -// Deprecated: NewCredUsername is a deprecated alias of NewCredentialUsername. |
46 | | -func NewCredUsername(username string) (*Cred, error) { |
47 | | - return NewCredentialUsername(username) |
48 | | -} |
49 | | - |
50 | | -// Deprecated: NewCredUserpassPlaintext is a deprecated alias of NewCredentialUserpassPlaintext. |
51 | | -func NewCredUserpassPlaintext(username string, password string) (*Cred, error) { |
52 | | - return NewCredentialUserpassPlaintext(username, password) |
53 | | -} |
54 | | - |
55 | | -// Deprecated: NewCredSshKey is a deprecated alias of NewCredentialSshKey. |
56 | | -func NewCredSshKey(username string, publicKeyPath string, privateKeyPath string, passphrase string) (*Cred, error) { |
57 | | - return NewCredentialSSHKey(username, publicKeyPath, privateKeyPath, passphrase) |
58 | | -} |
59 | | - |
60 | | -// Deprecated: NewCredSshKeyFromMemory is a deprecated alias of NewCredentialSSHKeyFromMemory. |
61 | | -func NewCredSshKeyFromMemory(username string, publicKey string, privateKey string, passphrase string) (*Cred, error) { |
62 | | - return NewCredentialSSHKeyFromMemory(username, publicKey, privateKey, passphrase) |
63 | | -} |
64 | | - |
65 | | -// Deprecated: NewCredSshKeyFromAgent is a deprecated alias of NewCredentialSSHFromAgent. |
66 | | -func NewCredSshKeyFromAgent(username string) (*Cred, error) { |
67 | | - return NewCredentialSSHKeyFromAgent(username) |
68 | | -} |
69 | | - |
70 | | -// Deprecated: NewCredDefault is a deprecated alias fof NewCredentialDefault. |
71 | | -func NewCredDefault() (*Cred, error) { |
72 | | - return NewCredentialDefault() |
73 | | -} |
74 | | - |
75 | | -// diff.go |
76 | | - |
77 | | -const ( |
78 | | - // Deprecated: DiffIgnoreWhitespaceEol is a deprecated alias of DiffIgnoreWhitespaceEOL. |
79 | | - DiffIgnoreWitespaceEol = DiffIgnoreWhitespaceEOL |
80 | | -) |
81 | | - |
82 | | -// features.go |
83 | | - |
84 | | -const ( |
85 | | - // Deprecated: FeatureHttps is a deprecated alias of FeatureHTTPS. |
86 | | - FeatureHttps = FeatureHTTPS |
87 | | - |
88 | | - // Deprecated: FeatureSsh is a deprecated alias of FeatureSSH. |
89 | | - FeatureSsh = FeatureSSH |
90 | | -) |
91 | | - |
92 | | -// git.go |
93 | | - |
94 | | -const ( |
95 | | - // Deprecated: ErrClassNone is a deprecated alias of ErrorClassNone. |
96 | | - ErrClassNone = ErrorClassNone |
97 | | - // Deprecated: ErrClassNoMemory is a deprecated alias of ErrorClassNoMemory. |
98 | | - ErrClassNoMemory = ErrorClassNoMemory |
99 | | - // Deprecated: ErrClassOs is a deprecated alias of ErrorClassOS. |
100 | | - ErrClassOs = ErrorClassOS |
101 | | - // Deprecated: ErrClassInvalid is a deprecated alias of ErrorClassInvalid. |
102 | | - ErrClassInvalid = ErrorClassInvalid |
103 | | - // Deprecated: ErrClassReference is a deprecated alias of ErrorClassReference. |
104 | | - ErrClassReference = ErrorClassReference |
105 | | - // Deprecated: ErrClassZlib is a deprecated alias of ErrorClassZlib. |
106 | | - ErrClassZlib = ErrorClassZlib |
107 | | - // Deprecated: ErrClassRepository is a deprecated alias of ErrorClassRepository. |
108 | | - ErrClassRepository = ErrorClassRepository |
109 | | - // Deprecated: ErrClassConfig is a deprecated alias of ErrorClassConfig. |
110 | | - ErrClassConfig = ErrorClassConfig |
111 | | - // Deprecated: ErrClassRegex is a deprecated alias of ErrorClassRegex. |
112 | | - ErrClassRegex = ErrorClassRegex |
113 | | - // Deprecated: ErrClassOdb is a deprecated alias of ErrorClassOdb. |
114 | | - ErrClassOdb = ErrorClassOdb |
115 | | - // Deprecated: ErrClassIndex is a deprecated alias of ErrorClassIndex. |
116 | | - ErrClassIndex = ErrorClassIndex |
117 | | - // Deprecated: ErrClassObject is a deprecated alias of ErrorClassObject. |
118 | | - ErrClassObject = ErrorClassObject |
119 | | - // Deprecated: ErrClassNet is a deprecated alias of ErrorClassNet. |
120 | | - ErrClassNet = ErrorClassNet |
121 | | - // Deprecated: ErrClassTag is a deprecated alias of ErrorClassTag. |
122 | | - ErrClassTag = ErrorClassTag |
123 | | - // Deprecated: ErrClassTree is a deprecated alias of ErrorClassTree. |
124 | | - ErrClassTree = ErrorClassTree |
125 | | - // Deprecated: ErrClassIndexer is a deprecated alias of ErrorClassIndexer. |
126 | | - ErrClassIndexer = ErrorClassIndexer |
127 | | - // Deprecated: ErrClassSSL is a deprecated alias of ErrorClassSSL. |
128 | | - ErrClassSSL = ErrorClassSSL |
129 | | - // Deprecated: ErrClassSubmodule is a deprecated alias of ErrorClassSubmodule. |
130 | | - ErrClassSubmodule = ErrorClassSubmodule |
131 | | - // Deprecated: ErrClassThread is a deprecated alias of ErrorClassThread. |
132 | | - ErrClassThread = ErrorClassThread |
133 | | - // Deprecated: ErrClassStash is a deprecated alias of ErrorClassStash. |
134 | | - ErrClassStash = ErrorClassStash |
135 | | - // Deprecated: ErrClassCheckout is a deprecated alias of ErrorClassCheckout. |
136 | | - ErrClassCheckout = ErrorClassCheckout |
137 | | - // Deprecated: ErrClassFetchHead is a deprecated alias of ErrorClassFetchHead. |
138 | | - ErrClassFetchHead = ErrorClassFetchHead |
139 | | - // Deprecated: ErrClassMerge is a deprecated alias of ErrorClassMerge. |
140 | | - ErrClassMerge = ErrorClassMerge |
141 | | - // Deprecated: ErrClassSsh is a deprecated alias of ErrorClassSSH. |
142 | | - ErrClassSsh = ErrorClassSSH |
143 | | - // Deprecated: ErrClassFilter is a deprecated alias of ErrorClassFilter. |
144 | | - ErrClassFilter = ErrorClassFilter |
145 | | - // Deprecated: ErrClassRevert is a deprecated alias of ErrorClassRevert. |
146 | | - ErrClassRevert = ErrorClassRevert |
147 | | - // Deprecated: ErrClassCallback is a deprecated alias of ErrorClassCallback. |
148 | | - ErrClassCallback = ErrorClassCallback |
149 | | - // Deprecated: ErrClassRebase is a deprecated alias of ErrorClassRebase. |
150 | | - ErrClassRebase = ErrorClassRebase |
151 | | - // Deprecated: ErrClassPatch is a deprecated alias of ErrorClassPatch. |
152 | | - ErrClassPatch = ErrorClassPatch |
153 | | -) |
154 | | - |
155 | | -const ( |
156 | | - // Deprecated: ErrOk is a deprecated alias of ErrorCodeOK. |
157 | | - ErrOk = ErrorCodeOK |
158 | | - // Deprecated: ErrGeneric is a deprecated alias of ErrorCodeGeneric. |
159 | | - ErrGeneric = ErrorCodeGeneric |
160 | | - // Deprecated: ErrNotFound is a deprecated alias of ErrorCodeNotFound. |
161 | | - ErrNotFound = ErrorCodeNotFound |
162 | | - // Deprecated: ErrExists is a deprecated alias of ErrorCodeExists. |
163 | | - ErrExists = ErrorCodeExists |
164 | | - // Deprecated: ErrAmbiguous is a deprecated alias of ErrorCodeAmbiguous. |
165 | | - ErrAmbiguous = ErrorCodeAmbiguous |
166 | | - // Deprecated: ErrAmbigious is a deprecated alias of ErrorCodeAmbiguous. |
167 | | - ErrAmbigious = ErrorCodeAmbiguous |
168 | | - // Deprecated: ErrBuffs is a deprecated alias of ErrorCodeBuffs. |
169 | | - ErrBuffs = ErrorCodeBuffs |
170 | | - // Deprecated: ErrUser is a deprecated alias of ErrorCodeUser. |
171 | | - ErrUser = ErrorCodeUser |
172 | | - // Deprecated: ErrBareRepo is a deprecated alias of ErrorCodeBareRepo. |
173 | | - ErrBareRepo = ErrorCodeBareRepo |
174 | | - // Deprecated: ErrUnbornBranch is a deprecated alias of ErrorCodeUnbornBranch. |
175 | | - ErrUnbornBranch = ErrorCodeUnbornBranch |
176 | | - // Deprecated: ErrUnmerged is a deprecated alias of ErrorCodeUnmerged. |
177 | | - ErrUnmerged = ErrorCodeUnmerged |
178 | | - // Deprecated: ErrNonFastForward is a deprecated alias of ErrorCodeNonFastForward. |
179 | | - ErrNonFastForward = ErrorCodeNonFastForward |
180 | | - // Deprecated: ErrInvalidSpec is a deprecated alias of ErrorCodeInvalidSpec. |
181 | | - ErrInvalidSpec = ErrorCodeInvalidSpec |
182 | | - // Deprecated: ErrConflict is a deprecated alias of ErrorCodeConflict. |
183 | | - ErrConflict = ErrorCodeConflict |
184 | | - // Deprecated: ErrLocked is a deprecated alias of ErrorCodeLocked. |
185 | | - ErrLocked = ErrorCodeLocked |
186 | | - // Deprecated: ErrModified is a deprecated alias of ErrorCodeModified. |
187 | | - ErrModified = ErrorCodeModified |
188 | | - // Deprecated: ErrAuth is a deprecated alias of ErrorCodeAuth. |
189 | | - ErrAuth = ErrorCodeAuth |
190 | | - // Deprecated: ErrCertificate is a deprecated alias of ErrorCodeCertificate. |
191 | | - ErrCertificate = ErrorCodeCertificate |
192 | | - // Deprecated: ErrApplied is a deprecated alias of ErrorCodeApplied. |
193 | | - ErrApplied = ErrorCodeApplied |
194 | | - // Deprecated: ErrPeel is a deprecated alias of ErrorCodePeel. |
195 | | - ErrPeel = ErrorCodePeel |
196 | | - // Deprecated: ErrEOF is a deprecated alias of ErrorCodeEOF. |
197 | | - ErrEOF = ErrorCodeEOF |
198 | | - // Deprecated: ErrUncommitted is a deprecated alias of ErrorCodeUncommitted. |
199 | | - ErrUncommitted = ErrorCodeUncommitted |
200 | | - // Deprecated: ErrDirectory is a deprecated alias of ErrorCodeDirectory. |
201 | | - ErrDirectory = ErrorCodeDirectory |
202 | | - // Deprecated: ErrMergeConflict is a deprecated alias of ErrorCodeMergeConflict. |
203 | | - ErrMergeConflict = ErrorCodeMergeConflict |
204 | | - // Deprecated: ErrPassthrough is a deprecated alias of ErrorCodePassthrough. |
205 | | - ErrPassthrough = ErrorCodePassthrough |
206 | | - // Deprecated: ErrIterOver is a deprecated alias of ErrorCodeIterOver. |
207 | | - ErrIterOver = ErrorCodeIterOver |
208 | | - // Deprecated: ErrApplyFail is a deprecated alias of ErrorCodeApplyFail. |
209 | | - ErrApplyFail = ErrorCodeApplyFail |
210 | | -) |
211 | | - |
212 | | -// index.go |
213 | | - |
214 | | -// Deprecated: IndexAddOpts is a deprecated alias of IndexAddOption. |
215 | | -type IndexAddOpts = IndexAddOption |
216 | | - |
217 | | -// Deprecated: IndexStageOpts is a deprecated alias of IndexStageState. |
218 | | -type IndexStageOpts = IndexStageState |
219 | | - |
220 | | -// submodule.go |
221 | | - |
222 | | -// Deprecated: SubmoduleCbk is a deprecated alias of SubmoduleCallback. |
223 | | -type SubmoduleCbk = SubmoduleCallback |
224 | | - |
225 | | -// Deprecated: SubmoduleVisitor is not used. |
226 | | -func SubmoduleVisitor(csub unsafe.Pointer, name *C.char, handle unsafe.Pointer) C.int { |
227 | | - sub := &Submodule{(*C.git_submodule)(csub), nil} |
228 | | - |
229 | | - callback, ok := pointerHandles.Get(handle).(SubmoduleCallback) |
230 | | - if !ok { |
231 | | - panic("invalid submodule visitor callback") |
232 | | - } |
233 | | - err := callback(sub, C.GoString(name)) |
234 | | - if err != nil { |
235 | | - return C.int(ErrorCodeUser) |
236 | | - } |
237 | | - return C.int(ErrorCodeOK) |
238 | | -} |
239 | | - |
240 | | -// reference.go |
241 | | - |
242 | | -// Deprecated: ReferenceIsValidName is a deprecated alias of ReferenceNameIsValid. |
243 | | -func ReferenceIsValidName(name string) bool { |
244 | | - valid, _ := ReferenceNameIsValid(name) |
245 | | - return valid |
246 | | -} |
247 | | - |
248 | | -// remote.go |
249 | | - |
250 | | -// Deprecated: RemoteIsValidName is a deprecated alias of RemoteNameIsValid. |
251 | | -func RemoteIsValidName(name string) bool { |
252 | | - valid, _ := RemoteNameIsValid(name) |
253 | | - return valid |
254 | | -} |
255 | | - |
256 | | -// tree.go |
257 | | - |
258 | | -// Deprecated: CallbackGitTreeWalk is not used. |
259 | | -func CallbackGitTreeWalk(_root *C.char, entry *C.git_tree_entry, ptr unsafe.Pointer) C.int { |
260 | | - root := C.GoString(_root) |
261 | | - |
262 | | - callback, ok := pointerHandles.Get(ptr).(TreeWalkCallback) |
263 | | - if !ok { |
264 | | - panic("invalid treewalk callback") |
265 | | - } |
266 | | - err := callback(root, newTreeEntry(entry)) |
267 | | - if err != nil { |
268 | | - return C.int(ErrorCodeUser) |
269 | | - } |
270 | | - return C.int(ErrorCodeOK) |
271 | | -} |
0 commit comments