diff options
Diffstat (limited to 'credential.c')
-rw-r--r-- | credential.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/credential.c b/credential.c index 3c17ea1973..a17eafea58 100644 --- a/credential.c +++ b/credential.c @@ -69,16 +69,30 @@ static int credential_config_callback(const char *var, const char *value, if (!c->username) c->username = xstrdup(value); } + else if (!strcmp(key, "usehttppath")) + c->use_http_path = git_config_bool(var, value); return 0; } +static int proto_is_http(const char *s) +{ + if (!s) + return 0; + return !strcmp(s, "https") || !strcmp(s, "http"); +} + static void credential_apply_config(struct credential *c) { if (c->configured) return; git_config(credential_config_callback, c); c->configured = 1; + + if (!c->use_http_path && proto_is_http(c->protocol)) { + free(c->path); + c->path = NULL; + } } static void credential_describe(struct credential *c, struct strbuf *out) |