Skip to content

Commit 16b305c

Browse files
ttaylorrpeff
authored andcommitted
credential.c: store "wwwauth[]" values in credential_read()
Teach git-credential to read "wwwauth[]" value(s) when parsing the output of a credential helper. These extra headers are not needed for Git's own HTTP support to use the feature internally, but the feature would not be available for a scripted caller (say, git-remote-mediawiki providing the header in the same way). As a bonus, this also makes it easier to use wwwauth[] in synthetic credential inputs in our test suite. Co-authored-by: Jeff King <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 48d89b5 commit 16b305c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

credential.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ int credential_read(struct credential *c, FILE *fp)
238238
} else if (!strcmp(key, "path")) {
239239
free(c->path);
240240
c->path = xstrdup(value);
241+
} else if (!strcmp(key, "wwwauth[]")) {
242+
strvec_push(&c->wwwauth_headers, value);
241243
} else if (!strcmp(key, "password_expiry_utc")) {
242244
errno = 0;
243245
c->password_expiry_utc = parse_timestamp(value, NULL, 10);

0 commit comments

Comments
 (0)