Skip to content

Commit fcaa6e6

Browse files
peffgitster
authored andcommitted
remote-curl: rename shadowed options variable
The discover_refs() function has a local "options" variable to hold the http_get_options we pass to http_get_strbuf(). But this shadows the global "struct options" that holds our program-level options, which cannot be accessed from this function. Let's give the local one a more descriptive name so we can tell the two apart. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6628eb4 commit fcaa6e6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

remote-curl.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static struct discovery *discover_refs(const char *service, int for_push)
254254
struct strbuf effective_url = STRBUF_INIT;
255255
struct discovery *last = last_discovery;
256256
int http_ret, maybe_smart = 0;
257-
struct http_get_options options;
257+
struct http_get_options http_options;
258258

259259
if (last && !strcmp(service, last->service))
260260
return last;
@@ -271,15 +271,15 @@ static struct discovery *discover_refs(const char *service, int for_push)
271271
strbuf_addf(&refs_url, "service=%s", service);
272272
}
273273

274-
memset(&options, 0, sizeof(options));
275-
options.content_type = &type;
276-
options.charset = &charset;
277-
options.effective_url = &effective_url;
278-
options.base_url = &url;
279-
options.no_cache = 1;
280-
options.keep_error = 1;
274+
memset(&http_options, 0, sizeof(http_options));
275+
http_options.content_type = &type;
276+
http_options.charset = &charset;
277+
http_options.effective_url = &effective_url;
278+
http_options.base_url = &url;
279+
http_options.no_cache = 1;
280+
http_options.keep_error = 1;
281281

282-
http_ret = http_get_strbuf(refs_url.buf, &buffer, &options);
282+
http_ret = http_get_strbuf(refs_url.buf, &buffer, &http_options);
283283
switch (http_ret) {
284284
case HTTP_OK:
285285
break;

0 commit comments

Comments
 (0)