]> git.ipfire.org Git - thirdparty/git.git/commitdiff
promisor-remote: compare remote names case sensitively
authorChristian Couder <christian.couder@gmail.com>
Tue, 18 Mar 2025 11:00:08 +0000 (12:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Mar 2025 19:22:34 +0000 (12:22 -0700)
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>
Documentation/config/promisor.adoc
promisor-remote.c

index 9192acfd2430975aec81d763f5fe180c4f30414f..2638b01f8308a1cfd0eb210e4ad405a4e44aea4d 100644 (file)
@@ -26,5 +26,5 @@ promisor.acceptFromServer::
        server will be accepted. By accepting a promisor remote, the
        client agrees that the server might omit objects that are
        lazily fetchable from this promisor remote from its responses
-       to "fetch" and "clone" requests from the client. See
-       linkgit:gitprotocol-v2[5].
+       to "fetch" and "clone" requests from the client. Name and URL
+       comparisons are case sensitive. See linkgit:gitprotocol-v2[5].
index 0b7b1ec45a35f7a350dd224a67e4c86c75997b2a..5801ebfd9b2c2bae3c230f8adb58dfba2c6ace0a 100644 (file)
@@ -370,13 +370,13 @@ char *promisor_remote_info(struct repository *repo)
 
 /*
  * Find first index of 'nicks' where there is 'nick'. 'nick' is
- * compared case insensitively to the strings in 'nicks'. If not found
+ * compared case sensitively to the strings in 'nicks'. If not found
  * 'nicks->nr' is returned.
  */
 static size_t remote_nick_find(struct strvec *nicks, const char *nick)
 {
        for (size_t i = 0; i < nicks->nr; i++)
-               if (!strcasecmp(nicks->v[i], nick))
+               if (!strcmp(nicks->v[i], nick))
                        return i;
        return nicks->nr;
 }