-
Notifications
You must be signed in to change notification settings - Fork 101
scalar: add test to verify http.version=HTTP/1.1 is set for Azure Repos URLs #754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,6 +230,33 @@ static int set_recommended_config(int reconfigure) | |
fsmonitor.key, fsmonitor.value); | ||
} | ||
|
||
/* | ||
* Set HTTP/1.1 for Azure DevOps URLs | ||
* We check for dev.azure.com/ and .visualstudio.com/ patterns | ||
* which are sufficient to identify ADO URLs (including formats like | ||
* https://orgname@dev.azure.com/...) | ||
*/ | ||
if (!git_config_get_string("remote.origin.url", &value)) { | ||
if (starts_with(value, "https://dev.azure.com/") || | ||
strstr(value, "@dev.azure.com/") || | ||
strstr(value, ".visualstudio.com/")) { | ||
struct strbuf key = STRBUF_INIT; | ||
strbuf_addf(&key, "http.%s.version", value); | ||
FREE_AND_NULL(value); | ||
|
||
if (reconfigure || git_config_get_string(key.buf, &value)) { | ||
trace2_data_string("scalar", the_repository, key.buf, "created"); | ||
if (git_config_set_gently(key.buf, "HTTP/1.1") < 0) { | ||
strbuf_release(&key); | ||
return error(_("could not configure %s=%s"), | ||
key.buf, "HTTP/1.1"); | ||
} | ||
} | ||
strbuf_release(&key); | ||
} | ||
FREE_AND_NULL(value); | ||
} | ||
|
||
/* | ||
* The `log.excludeDecoration` setting is special because it allows | ||
* for multiple values. | ||
|
@@ -869,7 +896,7 @@ static int cmd_clone(int argc, const char **argv) | |
/* Is --[no-]gvfs-protocol unspecified? Infer from url. */ | ||
if (gvfs_protocol < 0) { | ||
if (cache_server_url || | ||
strstr(url, "dev.azure.com") || | ||
strstr(url, "dev.azure.com/") || | ||
strstr(url, "visualstudio.com")) | ||
gvfs_protocol = 1; | ||
else | ||
|
@@ -886,7 +913,7 @@ static int cmd_clone(int argc, const char **argv) | |
cache_server_url = default_cache_server_url; | ||
if (set_config("core.useGVFSHelper=true") || | ||
set_config("core.gvfs=150") || | ||
set_config("http.version=HTTP/1.1")) { | ||
set_config("http.%s.version=HTTP/1.1", url)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be sufficient for answering my concerns for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dscho: Somehow the comment I tried to leave yesterday didn't come through. I must have started a review that didn't get complete. This line won't actually be sufficient because it's replacing a wider-focus config change for Sorry, this PR doesn't actually resolve the issue due to this problem. Hard to recognize when the diff isn't there and the tests do not cover a real-world example. |
||
res = error(_("could not turn on GVFS helper")); | ||
goto cleanup; | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.