Skip to content

Commit 2c0dcb9

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent caed258 commit 2c0dcb9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Documentation/config/promisor.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ promisor.acceptFromServer::
2626
server will be accepted. By accepting a promisor remote, the
2727
client agrees that the server might omit objects that are
2828
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,13 @@ char *promisor_remote_info(struct repository *repo)
370370

371371
/*
372372
* 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
374374
* 'nicks->nr' is returned.
375375
*/
376376
static size_t remote_nick_find(struct strvec *nicks, const char *nick)
377377
{
378378
for (size_t i = 0; i < nicks->nr; i++)
379-
if (!strcasecmp(nicks->v[i], nick))
379+
if (!strcmp(nicks->v[i], nick))
380380
return i;
381381
return nicks->nr;
382382
}

0 commit comments

Comments
 (0)