git credential fill: output the whole 'struct credential'

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>
This commit is contained in:
Matthieu Moy
2012-06-24 13:40:00 +02:00
committed by Junio C Hamano
parent e30b2feb1b
commit 2d6dc182b8
6 changed files with 54 additions and 9 deletions

View File

@ -191,7 +191,7 @@ static void credential_write_item(FILE *fp, const char *key, const char *value)
fprintf(fp, "%s=%s\n", key, value);
}
static void credential_write(const struct credential *c, FILE *fp)
void credential_write(const struct credential *c, FILE *fp)
{
credential_write_item(fp, "protocol", c->protocol);
credential_write_item(fp, "host", c->host);