Skip to content

Commit 917ba76

Browse files
committed
auth: update enum type name for consistency
libgit2 does not use `type_t` suffixes as it's redundant; thus, rename `git_http_authtype_t` to `git_http_auth_t` for consistency.
1 parent b59c71d commit 917ba76

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/transports/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int basic_next_token(
4747
}
4848

4949
static git_http_auth_context basic_context = {
50-
GIT_AUTHTYPE_BASIC,
50+
GIT_HTTP_AUTH_BASIC,
5151
GIT_CREDTYPE_USERPASS_PLAINTEXT,
5252
0,
5353
NULL,

src/transports/auth.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
#include "netops.h"
1515

1616
typedef enum {
17-
GIT_AUTHTYPE_BASIC = 1,
18-
GIT_AUTHTYPE_NEGOTIATE = 2,
19-
GIT_AUTHTYPE_NTLM = 4,
20-
} git_http_authtype_t;
17+
GIT_HTTP_AUTH_BASIC = 1,
18+
GIT_HTTP_AUTH_NEGOTIATE = 2,
19+
GIT_HTTP_AUTH_NTLM = 4,
20+
} git_http_auth_t;
2121

2222
typedef struct git_http_auth_context git_http_auth_context;
2323

2424
struct git_http_auth_context {
2525
/** Type of scheme */
26-
git_http_authtype_t type;
26+
git_http_auth_t type;
2727

2828
/** Supported credentials */
2929
git_credtype_t credtypes;
@@ -46,7 +46,7 @@ struct git_http_auth_context {
4646

4747
typedef struct {
4848
/** Type of scheme */
49-
git_http_authtype_t type;
49+
git_http_auth_t type;
5050

5151
/** Name of the scheme (as used in the Authorization header) */
5252
const char *name;

src/transports/auth_negotiate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ int git_http_auth_negotiate(
274274
return -1;
275275
}
276276

277-
ctx->parent.type = GIT_AUTHTYPE_NEGOTIATE;
277+
ctx->parent.type = GIT_HTTP_AUTH_NEGOTIATE;
278278
ctx->parent.credtypes = GIT_CREDTYPE_DEFAULT;
279279
ctx->parent.connection_affinity = 1;
280280
ctx->parent.set_challenge = negotiate_set_challenge;

src/transports/auth_ntlm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ int git_http_auth_ntlm(
207207
return -1;
208208
}
209209

210-
ctx->parent.type = GIT_AUTHTYPE_NTLM;
210+
ctx->parent.type = GIT_HTTP_AUTH_NTLM;
211211
ctx->parent.credtypes = GIT_CREDTYPE_USERPASS_PLAINTEXT;
212212
ctx->parent.connection_affinity = 1;
213213
ctx->parent.set_challenge = ntlm_set_challenge;

src/transports/http.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
#include "streams/socket.h"
2727

2828
git_http_auth_scheme auth_schemes[] = {
29-
{ GIT_AUTHTYPE_NEGOTIATE, "Negotiate", GIT_CREDTYPE_DEFAULT, git_http_auth_negotiate },
30-
{ GIT_AUTHTYPE_NTLM, "NTLM", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_ntlm },
31-
{ GIT_AUTHTYPE_BASIC, "Basic", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_basic },
29+
{ GIT_HTTP_AUTH_NEGOTIATE, "Negotiate", GIT_CREDTYPE_DEFAULT, git_http_auth_negotiate },
30+
{ GIT_HTTP_AUTH_NTLM, "NTLM", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_ntlm },
31+
{ GIT_HTTP_AUTH_BASIC, "Basic", GIT_CREDTYPE_USERPASS_PLAINTEXT, git_http_auth_basic },
3232
};
3333

3434
static const char *upload_pack_service = "upload-pack";
@@ -78,7 +78,7 @@ typedef struct {
7878
git_net_url url;
7979
git_stream *stream;
8080

81-
git_http_authtype_t authtypes;
81+
git_http_auth_t authtypes;
8282
git_credtype_t credtypes;
8383

8484
git_cred *cred;

0 commit comments

Comments
 (0)