mirror of
https://github.com/git/git.git
synced 2024-11-25 02:44:48 +08:00
2d6dc182b8
Instead of outputing only the username and password, print all the attributes, even those that already appeared in the input. This is closer to what the C API does, and allows one to take the exact output of "git credential fill" as input to "git credential approve" or "git credential reject". Signed-off-by: Junio C Hamano <gitster@pobox.com>
35 lines
822 B
C
35 lines
822 B
C
#ifndef CREDENTIAL_H
|
|
#define CREDENTIAL_H
|
|
|
|
#include "string-list.h"
|
|
|
|
struct credential {
|
|
struct string_list helpers;
|
|
unsigned approved:1,
|
|
configured:1,
|
|
use_http_path:1;
|
|
|
|
char *username;
|
|
char *password;
|
|
char *protocol;
|
|
char *host;
|
|
char *path;
|
|
};
|
|
|
|
#define CREDENTIAL_INIT { STRING_LIST_INIT_DUP }
|
|
|
|
void credential_init(struct credential *);
|
|
void credential_clear(struct credential *);
|
|
|
|
void credential_fill(struct credential *);
|
|
void credential_approve(struct credential *);
|
|
void credential_reject(struct credential *);
|
|
|
|
int credential_read(struct credential *, FILE *);
|
|
void credential_write(const struct credential *, FILE *);
|
|
void credential_from_url(struct credential *, const char *url);
|
|
int credential_match(const struct credential *have,
|
|
const struct credential *want);
|
|
|
|
#endif /* CREDENTIAL_H */
|