summaryrefslogtreecommitdiff
path: root/credential.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-07-18 08:06:26 -0400
committerJunio C Hamano <gitster@pobox.com>2012-07-18 13:26:58 -0700
commit9c183a70722804114ac1dc54d17fe791ac1a452c (patch)
treeb48463c9c4bd5d7ecfff1aac55cd0715f02f8d5c /credential.c
parent6319a2a148adaa78f11414e914f8c9f3f1c52b5e (diff)
downloadgit-9c183a70722804114ac1dc54d17fe791ac1a452c.tar.gz
credential: convert "url" attribute into its parsed subparts
The git-credential command requires that you feed it a broken-down credential, which means that the client needs to parse a URL itself. Since we have our own URL-parsing routines, we can easily allow the caller to just give us the URL as-is, saving them some code. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'credential.c')
-rw-r--r--credential.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/credential.c b/credential.c
index 2c400073fa..e54753c75d 100644
--- a/credential.c
+++ b/credential.c
@@ -172,6 +172,8 @@ int credential_read(struct credential *c, FILE *fp)
} else if (!strcmp(key, "path")) {
free(c->path);
c->path = xstrdup(value);
+ } else if (!strcmp(key, "url")) {
+ credential_from_url(c, value);
}
/*
* Ignore other lines; we don't know what they mean, but