Skip to content

Commit 810cefd

Browse files
committed
credentials: suffix the callbacks with _cb
The credential callbacks should match the other callback naming conventions, using the `_cb` suffix instead of a `_callback` suffix.
1 parent e50d138 commit 810cefd

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

include/git2/deprecated.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,21 @@ GIT_EXTERN(void) giterr_set_oom(void);
246246

247247
/**@}*/
248248

249+
/** @name Deprecated Credential Callback Types
250+
*
251+
* These types are retained for backward compatibility. The newer
252+
* versions of these values should be preferred in all new code.
253+
*
254+
* There is no plan to remove these backward compatibility values at
255+
* this time.
256+
*/
257+
/**@{*/
258+
259+
typedef git_cred_sign_cb git_cred_sign_callback;
260+
typedef git_cred_ssh_interactive_cb git_cred_ssh_interactive_callback;
261+
262+
/**@}*/
263+
249264
/** @name Deprecated Transfer Progress Types
250265
*
251266
* These types are retained for backward compatibility. The newer

include/git2/transport.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT LIBSSH2_USERAUTH_KBDINT_PROMPT;
165165
typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE LIBSSH2_USERAUTH_KBDINT_RESPONSE;
166166
#endif
167167

168-
typedef int GIT_CALLBACK(git_cred_sign_callback)(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract);
169-
typedef void GIT_CALLBACK(git_cred_ssh_interactive_callback)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract);
168+
typedef int GIT_CALLBACK(git_cred_sign_cb)(LIBSSH2_SESSION *session, unsigned char **sig, size_t *sig_len, const unsigned char *data, size_t data_len, void **abstract);
169+
typedef void GIT_CALLBACK(git_cred_ssh_interactive_cb)(const char* name, int name_len, const char* instruction, int instruction_len, int num_prompts, const LIBSSH2_USERAUTH_KBDINT_PROMPT* prompts, LIBSSH2_USERAUTH_KBDINT_RESPONSE* responses, void **abstract);
170170

171171
/**
172172
* A ssh key from disk
@@ -185,7 +185,7 @@ typedef struct git_cred_ssh_key {
185185
typedef struct git_cred_ssh_interactive {
186186
git_cred parent;
187187
char *username;
188-
git_cred_ssh_interactive_callback prompt_callback;
188+
git_cred_ssh_interactive_cb prompt_callback;
189189
void *payload;
190190
} git_cred_ssh_interactive;
191191

@@ -197,7 +197,7 @@ typedef struct git_cred_ssh_custom {
197197
char *username;
198198
char *publickey;
199199
size_t publickey_len;
200-
git_cred_sign_callback sign_callback;
200+
git_cred_sign_cb sign_callback;
201201
void *payload;
202202
} git_cred_ssh_custom;
203203

@@ -262,7 +262,7 @@ GIT_EXTERN(int) git_cred_ssh_key_new(
262262
GIT_EXTERN(int) git_cred_ssh_interactive_new(
263263
git_cred **out,
264264
const char *username,
265-
git_cred_ssh_interactive_callback prompt_callback,
265+
git_cred_ssh_interactive_cb prompt_callback,
266266
void *payload);
267267

268268
/**
@@ -300,7 +300,7 @@ GIT_EXTERN(int) git_cred_ssh_custom_new(
300300
const char *username,
301301
const char *publickey,
302302
size_t publickey_len,
303-
git_cred_sign_callback sign_callback,
303+
git_cred_sign_cb sign_callback,
304304
void *payload);
305305

306306
/**

src/transports/cred.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static int git_cred_ssh_key_type_new(
264264
int git_cred_ssh_interactive_new(
265265
git_cred **out,
266266
const char *username,
267-
git_cred_ssh_interactive_callback prompt_callback,
267+
git_cred_ssh_interactive_cb prompt_callback,
268268
void *payload)
269269
{
270270
git_cred_ssh_interactive *c;
@@ -312,7 +312,7 @@ int git_cred_ssh_custom_new(
312312
const char *username,
313313
const char *publickey,
314314
size_t publickey_len,
315-
git_cred_sign_callback sign_callback,
315+
git_cred_sign_cb sign_callback,
316316
void *payload)
317317
{
318318
git_cred_ssh_custom *c;

0 commit comments

Comments
 (0)