promisor-remote: compare remote names case sensitively
Because the "[remote "nick"] fetch = ..." configuration variables have the nickname in the second part, the nicknames are case sensitive, unlike the first and the third component (i.e. "remote.origin.fetch" and "Remote.origin.FETCH" are the same thing, but "remote.Origin.fetch" and "remote.origin.fetch" are different). Let's follow the way Git works in general and compare the remote names case sensitively when processing advertised remotes. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Mar 18, 2025 at 12:00 UTC
2c0dcb9754959c9b917634313fb448fce5052642
2 files changed
+4
-4
Documentation/config/promisor.adoc
+2
-2
@@ -26,5 +26,5 @@ promisor.acceptFromServer::
26
server will be accepted. By accepting a promisor remote, the
27
client agrees that the server might omit objects that are
28
lazily fetchable from this promisor remote from its responses
29
- to "fetch" and "clone" requests from the client. See
30
- linkgit:gitprotocol-v2[5].
29
+ to "fetch" and "clone" requests from the client. Name and URL
30
+ comparisons are case sensitive. See linkgit:gitprotocol-v2[5].
promisor-remote.c
+2
-2
@@ -370,13 +370,13 @@ char *promisor_remote_info(struct repository *repo)
370
371
/*
372
* Find first index of 'nicks' where there is 'nick'. 'nick' is
373
- * compared case insensitively to the strings in 'nicks'. If not found
373
+ * compared case sensitively to the strings in 'nicks'. If not found
374
* 'nicks->nr' is returned.
375
*/
376
static size_t remote_nick_find(struct strvec *nicks, const char *nick)
377
{
378
for (size_t i = 0; i < nicks->nr; i++)
379
- if (!strcasecmp(nicks->v[i], nick))
379
+ if (!strcmp(nicks->v[i], nick))
380
return i;
381
return nicks->nr;
382
}