{"thread":{"id":"62952","subject":"[GSoC][PATCH] refspec: clarify function naming and documentation","startedAt":"2025-02-14T05:39:50Z","lastAt":"2025-02-15T08:45:47Z","messageCount":3,"participants":["Meet Soni","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"512406","messageId":"20250214053938.26807-1-meetsoni3017@gmail.com","threadId":"62952","inReplyTo":null,"subject":"[GSoC][PATCH] refspec: clarify function naming and documentation","fromName":"Meet Soni","fromEmail":"meetsoni3017@gmail.com","sentAt":"2025-02-14T05:39:38Z","receivedAt":"2025-02-14T05:39:50Z","isPatch":true,"sender":{"key":"meetsoni3017@gmail.com","avatar":"https://avatars.githubusercontent.com/u/92802561?v=4"},"body":"Rename `match_name_with_pattern()` to `match_refname_with_pattern()` to\nbetter reflect its purpose and improve documentation comment clarity.\nThe previous function name and parameter names were inconsistent, making\nit harder to understand their roles in refspec matching.\n\n- Rename parameters:\n  - `key` -> `src_pattern` (source globbing pattern)\n  - `name` -> `refname` (refname to check)\n  - `value` -> `dst_pattern` (destination mapping pattern)\n\nSigned-off-by: Meet Soni <meetsoni3017@gmail.com>\n---\nThis change was previously discussed in an earlier patch series [1], where\nJunio suggested making this update after the dust settled there.\n\n[1]: https://lore.kernel.org/git/xmqqa5bctbnx.fsf@gitster.g/\n\n refspec.c | 34 +++++++++++++++++-----------------\n refspec.h |  9 +++++----\n remote.c  |  6 +++---\n 3 files changed, 25 insertions(+), 24 deletions(-)\n\ndiff --git a/refspec.c b/refspec.c\nindex 3d6cf4dc92..329de7bb18 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -269,28 +269,28 @@ void refspec_ref_prefixes(const struct refspec *rs,\n \t}\n }\n \n-int match_name_with_pattern(const char *key, const char *name,\n-\t\t\t\t   const char *value, char **result)\n+int match_refname_with_pattern(const char *src_pattern, const char *refname,\n+\t\t\t\t   const char *dst_pattern, char **result)\n {\n-\tconst char *kstar = strchr(key, '*');\n+\tconst char *kstar = strchr(src_pattern, '*');\n \tsize_t klen;\n \tsize_t ksuffixlen;\n \tsize_t namelen;\n \tint ret;\n \tif (!kstar)\n-\t\tdie(_(\"key '%s' of pattern had no '*'\"), key);\n-\tklen = kstar - key;\n+\t\tdie(_(\"source pattern '%s' has no '*'\"), src_pattern);\n+\tklen = kstar - src_pattern;\n \tksuffixlen = strlen(kstar + 1);\n-\tnamelen = strlen(name);\n-\tret = !strncmp(name, key, klen) && namelen >= klen + ksuffixlen &&\n-\t\t!memcmp(name + namelen - ksuffixlen, kstar + 1, ksuffixlen);\n-\tif (ret && value) {\n+\tnamelen = strlen(refname);\n+\tret = !strncmp(refname, src_pattern, klen) && namelen >= klen + ksuffixlen &&\n+\t\t!memcmp(refname + namelen - ksuffixlen, kstar + 1, ksuffixlen);\n+\tif (ret && dst_pattern) {\n \t\tstruct strbuf sb = STRBUF_INIT;\n-\t\tconst char *vstar = strchr(value, '*');\n+\t\tconst char *vstar = strchr(dst_pattern, '*');\n \t\tif (!vstar)\n-\t\t\tdie(_(\"value '%s' of pattern has no '*'\"), value);\n-\t\tstrbuf_add(&sb, value, vstar - value);\n-\t\tstrbuf_add(&sb, name + klen, namelen - klen - ksuffixlen);\n+\t\t\tdie(_(\"destination pattern '%s' has no '*'\"), dst_pattern);\n+\t\tstrbuf_add(&sb, dst_pattern, vstar - dst_pattern);\n+\t\tstrbuf_add(&sb, refname + klen, namelen - klen - ksuffixlen);\n \t\tstrbuf_addstr(&sb, vstar + 1);\n \t\t*result = strbuf_detach(&sb, NULL);\n \t}\n@@ -301,7 +301,7 @@ static int refspec_match(const struct refspec_item *refspec,\n \t\t\t const char *name)\n {\n \tif (refspec->pattern)\n-\t\treturn match_name_with_pattern(refspec->src, name, NULL, NULL);\n+\t\treturn match_refname_with_pattern(refspec->src, name, NULL, NULL);\n \n \treturn !strcmp(refspec->src, name);\n }\n@@ -352,7 +352,7 @@ static int refspec_find_negative_match(struct refspec *rs, struct refspec_item *\n \t\t\tconst char *key = refspec->dst ? refspec->dst : refspec->src;\n \t\t\tconst char *value = refspec->src;\n \n-\t\t\tif (match_name_with_pattern(key, needle, value, &expn_name))\n+\t\t\tif (match_refname_with_pattern(key, needle, value, &expn_name))\n \t\t\t\tstring_list_append_nodup(&reversed, expn_name);\n \t\t} else if (refspec->matching) {\n \t\t\t/* For the special matching refspec, any query should match */\n@@ -397,7 +397,7 @@ void refspec_find_all_matches(struct refspec *rs,\n \t\tif (!refspec->dst || refspec->negative)\n \t\t\tcontinue;\n \t\tif (refspec->pattern) {\n-\t\t\tif (match_name_with_pattern(key, needle, value, result))\n+\t\t\tif (match_refname_with_pattern(key, needle, value, result))\n \t\t\t\tstring_list_append_nodup(results, *result);\n \t\t} else if (!strcmp(needle, key)) {\n \t\t\tstring_list_append(results, value);\n@@ -426,7 +426,7 @@ int refspec_find_match(struct refspec *rs, struct refspec_item *query)\n \t\tif (!refspec->dst || refspec->negative)\n \t\t\tcontinue;\n \t\tif (refspec->pattern) {\n-\t\t\tif (match_name_with_pattern(key, needle, value, result)) {\n+\t\t\tif (match_refname_with_pattern(key, needle, value, result)) {\n \t\t\t\tquery->force = refspec->force;\n \t\t\t\treturn 0;\n \t\t\t}\ndiff --git a/refspec.h b/refspec.h\nindex f62f83a7ee..6cec985b07 100644\n--- a/refspec.h\n+++ b/refspec.h\n@@ -75,11 +75,12 @@ void refspec_ref_prefixes(const struct refspec *rs,\n int refname_matches_negative_refspec_item(const char *refname, struct refspec *rs);\n \n /*\n- * Checks whether a name matches a pattern and optionally generates a result.\n- * Returns 1 if the name matches the pattern, 0 otherwise.\n+ * Checks if a refname matches a globbing refspec pattern.\n+ * If dst_pattern is provided, computes the mapped destination refname.\n+ * Returns 1 if refname matches src_pattern, 0 otherwise.\n  */\n-int match_name_with_pattern(const char *key, const char *name,\n-\t\t\t\t   const char *value, char **result);\n+int match_refname_with_pattern(const char *src_pattern, const char *refname,\n+\t\t\t\t   const char *dst_pattern, char **result);\n \n /*\n  * Queries a refspec for a match and updates the query item.\ndiff --git a/remote.c b/remote.c\nindex 5574b6a00f..5d3d1773dc 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1322,9 +1322,9 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref,\n \t\t\tconst char *dst_side = item->dst ? item->dst : item->src;\n \t\t\tint match;\n \t\t\tif (direction == FROM_SRC)\n-\t\t\t\tmatch = match_name_with_pattern(item->src, ref->name, dst_side, &name);\n+\t\t\t\tmatch = match_refname_with_pattern(item->src, ref->name, dst_side, &name);\n \t\t\telse\n-\t\t\t\tmatch = match_name_with_pattern(dst_side, ref->name, item->src, &name);\n+\t\t\t\tmatch = match_refname_with_pattern(dst_side, ref->name, item->src, &name);\n \t\t\tif (match) {\n \t\t\t\tmatching_refs = i;\n \t\t\t\tbreak;\n@@ -1942,7 +1942,7 @@ static struct ref *get_expanded_map(const struct ref *remote_refs,\n \n \t\tif (strchr(ref->name, '^'))\n \t\t\tcontinue; /* a dereference item */\n-\t\tif (match_name_with_pattern(refspec->src, ref->name,\n+\t\tif (match_refname_with_pattern(refspec->src, ref->name,\n \t\t\t\t\t    refspec->dst, &expn_name) &&\n \t\t    !ignore_symref_update(expn_name, &scratch)) {\n \t\t\tstruct ref *cpy = copy_ref(ref);\n\nbase-commit: e2067b49ecaef9b7f51a17ce251f9207f72ef52d\n-- \n2.34.1\n\n"},{"id":"512433","messageId":"xmqqldu8l5hq.fsf@gitster.g","threadId":"62952","inReplyTo":"20250214053938.26807-1-meetsoni3017@gmail.com","subject":"Re: [GSoC][PATCH] refspec: clarify function naming and documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-02-14T18:56:49Z","receivedAt":"2025-02-14T18:56:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Meet Soni <meetsoni3017@gmail.com> writes:\n\n> Rename `match_name_with_pattern()` to `match_refname_with_pattern()` to\n> better reflect its purpose and improve documentation comment clarity.\n> The previous function name and parameter names were inconsistent, making\n> it harder to understand their roles in refspec matching.\n>\n> - Rename parameters:\n>   - `key` -> `src_pattern` (source globbing pattern)\n>   - `name` -> `refname` (refname to check)\n>   - `value` -> `dst_pattern` (destination mapping pattern)\n>\n> Signed-off-by: Meet Soni <meetsoni3017@gmail.com>\n> ---\n> This change was previously discussed in an earlier patch series [1], where\n> Junio suggested making this update after the dust settled there.\n>\n> [1]: https://lore.kernel.org/git/xmqqa5bctbnx.fsf@gitster.g/\n\nYeah, and the dust settled a few days ago when the\nms/refspec-cleanup topic graduated to the 'master' branch.\n\nThanks for that work.\n\nThe tldr is that I like two things in the above rename, and find two\nthings problematic.  \"name->refname\" is very good, adding \"pattern\"\nis very good.  using \"src\" and \"dst\" is problematic.\n\nOne thing to note is that match_refname_with_pattern() can also be\nused to reverse map.\n\nA refspec that says \"refs/heads/*:refs/remotes/origin/*\" can be used\nto answer these two questions:\n\n * I see what they call \"refs/heads/master\", where should I store it?\n\n * I have \"refs/remotes/origin/main\", where did it come from?\n\nThe src/dst distinction you updated the parameters to the function\nonly reflects the first usage, and it is a bit confusing when the\ncode asks the other question.\n\n    Find the \"refname\" in A and replace the same glob part in B when\n    it finds a match\n\nis what the function does, and we used to call A=key and B=value,\nwhich were not great.  With \"pattern\" in their names, the new names\n\"src/dst_pattern\" are improvement, but src/dst hints as if they are\ndirectly related to src/dst sides of a refspec, which is the source\nof possible confusion when we talk about the \"please map from our\nremote-tracking branch name to the branch name at the origin\" use\ncase.\n\nSo, I very much have problems with the \"(*source* globbing pattern)\"\nyou state as the reasoning beind the new name in the proposed log\nmessage and \"src/dst\" in these names.\n\nWhat do other people who wrote tools that do something very similar\ncall these two things?  For example, \"sed -e 's/A/B/'\" command does\n\"find A and replace with B\".  They call A=RE and B=replacement\n\nPerhaps \"key -> pattern\" and \"value -> replacement\" would be a\nbetter pair of names that are easier to understand?  I dunno.\n\n> -int match_name_with_pattern(const char *key, const char *name,\n> -\t\t\t\t   const char *value, char **result)\n> +int match_refname_with_pattern(const char *src_pattern, const char *refname,\n> +\t\t\t\t   const char *dst_pattern, char **result)\n>  {\n\nThanks.\n"},{"id":"512458","messageId":"20250215084539.73799-1-meetsoni3017@gmail.com","threadId":"62952","inReplyTo":"20250214053938.26807-1-meetsoni3017@gmail.com","subject":"[GSoC][PATCH v2] refspec: clarify function naming and documentation","fromName":"Meet Soni","fromEmail":"meetsoni3017@gmail.com","sentAt":"2025-02-15T08:45:39Z","receivedAt":"2025-02-15T08:45:47Z","isPatch":true,"sender":{"key":"meetsoni3017@gmail.com","avatar":"https://avatars.githubusercontent.com/u/92802561?v=4"},"body":"Rename `match_name_with_pattern()` to `match_refname_with_pattern()` to\nbetter reflect its purpose and improve documentation comment clarity.\nThe previous function name and parameter names were inconsistent, making\nit harder to understand their roles in refspec matching.\n\n- Rename parameters:\n  - `key` -> `pattern` (globbing pattern to match)\n  - `name` -> `refname` (refname to check)\n  - `value` -> `replacement` (replacement mapping pattern)\n\nSigned-off-by: Meet Soni <meetsoni3017@gmail.com>\n---\nchanges in v2:\n    - updated parameter names as per review. Namely:\n        - `src_pattern` -> `pattern`\n        - `dst_pattern` -> `replacement`\n    - updated comment and commit message.\n\nRange-diff against v1:\n1:  8bd849b7c2 ! 1:  aa47431720 refspec: clarify function naming and documentation\n    @@ Commit message\n         it harder to understand their roles in refspec matching.\n     \n         - Rename parameters:\n    -      - `key` -> `src_pattern` (source globbing pattern)\n    +      - `key` -> `pattern` (globbing pattern to match)\n           - `name` -> `refname` (refname to check)\n    -      - `value` -> `dst_pattern` (destination mapping pattern)\n    +      - `value` -> `replacement` (replacement mapping pattern)\n     \n         Signed-off-by: Meet Soni <meetsoni3017@gmail.com>\n     \n    @@ refspec.c: void refspec_ref_prefixes(const struct refspec *rs,\n      \n     -int match_name_with_pattern(const char *key, const char *name,\n     -\t\t\t\t   const char *value, char **result)\n    -+int match_refname_with_pattern(const char *src_pattern, const char *refname,\n    -+\t\t\t\t   const char *dst_pattern, char **result)\n    ++int match_refname_with_pattern(const char *pattern, const char *refname,\n    ++\t\t\t\t   const char *replacement, char **result)\n      {\n     -\tconst char *kstar = strchr(key, '*');\n    -+\tconst char *kstar = strchr(src_pattern, '*');\n    ++\tconst char *kstar = strchr(pattern, '*');\n      \tsize_t klen;\n      \tsize_t ksuffixlen;\n      \tsize_t namelen;\n    @@ refspec.c: void refspec_ref_prefixes(const struct refspec *rs,\n      \tif (!kstar)\n     -\t\tdie(_(\"key '%s' of pattern had no '*'\"), key);\n     -\tklen = kstar - key;\n    -+\t\tdie(_(\"source pattern '%s' has no '*'\"), src_pattern);\n    -+\tklen = kstar - src_pattern;\n    ++\t\tdie(_(\"pattern '%s' has no '*'\"), pattern);\n    ++\tklen = kstar - pattern;\n      \tksuffixlen = strlen(kstar + 1);\n     -\tnamelen = strlen(name);\n     -\tret = !strncmp(name, key, klen) && namelen >= klen + ksuffixlen &&\n     -\t\t!memcmp(name + namelen - ksuffixlen, kstar + 1, ksuffixlen);\n     -\tif (ret && value) {\n     +\tnamelen = strlen(refname);\n    -+\tret = !strncmp(refname, src_pattern, klen) && namelen >= klen + ksuffixlen &&\n    ++\tret = !strncmp(refname, pattern, klen) && namelen >= klen + ksuffixlen &&\n     +\t\t!memcmp(refname + namelen - ksuffixlen, kstar + 1, ksuffixlen);\n    -+\tif (ret && dst_pattern) {\n    ++\tif (ret && replacement) {\n      \t\tstruct strbuf sb = STRBUF_INIT;\n     -\t\tconst char *vstar = strchr(value, '*');\n    -+\t\tconst char *vstar = strchr(dst_pattern, '*');\n    ++\t\tconst char *vstar = strchr(replacement, '*');\n      \t\tif (!vstar)\n     -\t\t\tdie(_(\"value '%s' of pattern has no '*'\"), value);\n     -\t\tstrbuf_add(&sb, value, vstar - value);\n     -\t\tstrbuf_add(&sb, name + klen, namelen - klen - ksuffixlen);\n    -+\t\t\tdie(_(\"destination pattern '%s' has no '*'\"), dst_pattern);\n    -+\t\tstrbuf_add(&sb, dst_pattern, vstar - dst_pattern);\n    ++\t\t\tdie(_(\"replacement '%s' has no '*'\"), replacement);\n    ++\t\tstrbuf_add(&sb, replacement, vstar - replacement);\n     +\t\tstrbuf_add(&sb, refname + klen, namelen - klen - ksuffixlen);\n      \t\tstrbuf_addstr(&sb, vstar + 1);\n      \t\t*result = strbuf_detach(&sb, NULL);\n    @@ refspec.h: void refspec_ref_prefixes(const struct refspec *rs,\n     - * Checks whether a name matches a pattern and optionally generates a result.\n     - * Returns 1 if the name matches the pattern, 0 otherwise.\n     + * Checks if a refname matches a globbing refspec pattern.\n    -+ * If dst_pattern is provided, computes the mapped destination refname.\n    -+ * Returns 1 if refname matches src_pattern, 0 otherwise.\n    ++ * If replacement is provided, computes the corresponding mapped refname.\n    ++ * Returns 1 if refname matches pattern, 0 otherwise.\n       */\n     -int match_name_with_pattern(const char *key, const char *name,\n     -\t\t\t\t   const char *value, char **result);\n    -+int match_refname_with_pattern(const char *src_pattern, const char *refname,\n    -+\t\t\t\t   const char *dst_pattern, char **result);\n    ++int match_refname_with_pattern(const char *pattern, const char *refname,\n    ++\t\t\t\t   const char *replacement, char **result);\n      \n      /*\n       * Queries a refspec for a match and updates the query item.\n\n refspec.c | 34 +++++++++++++++++-----------------\n refspec.h |  9 +++++----\n remote.c  |  6 +++---\n 3 files changed, 25 insertions(+), 24 deletions(-)\n\ndiff --git a/refspec.c b/refspec.c\nindex 3d6cf4dc92..4cb80b5208 100644\n--- a/refspec.c\n+++ b/refspec.c\n@@ -269,28 +269,28 @@ void refspec_ref_prefixes(const struct refspec *rs,\n \t}\n }\n \n-int match_name_with_pattern(const char *key, const char *name,\n-\t\t\t\t   const char *value, char **result)\n+int match_refname_with_pattern(const char *pattern, const char *refname,\n+\t\t\t\t   const char *replacement, char **result)\n {\n-\tconst char *kstar = strchr(key, '*');\n+\tconst char *kstar = strchr(pattern, '*');\n \tsize_t klen;\n \tsize_t ksuffixlen;\n \tsize_t namelen;\n \tint ret;\n \tif (!kstar)\n-\t\tdie(_(\"key '%s' of pattern had no '*'\"), key);\n-\tklen = kstar - key;\n+\t\tdie(_(\"pattern '%s' has no '*'\"), pattern);\n+\tklen = kstar - pattern;\n \tksuffixlen = strlen(kstar + 1);\n-\tnamelen = strlen(name);\n-\tret = !strncmp(name, key, klen) && namelen >= klen + ksuffixlen &&\n-\t\t!memcmp(name + namelen - ksuffixlen, kstar + 1, ksuffixlen);\n-\tif (ret && value) {\n+\tnamelen = strlen(refname);\n+\tret = !strncmp(refname, pattern, klen) && namelen >= klen + ksuffixlen &&\n+\t\t!memcmp(refname + namelen - ksuffixlen, kstar + 1, ksuffixlen);\n+\tif (ret && replacement) {\n \t\tstruct strbuf sb = STRBUF_INIT;\n-\t\tconst char *vstar = strchr(value, '*');\n+\t\tconst char *vstar = strchr(replacement, '*');\n \t\tif (!vstar)\n-\t\t\tdie(_(\"value '%s' of pattern has no '*'\"), value);\n-\t\tstrbuf_add(&sb, value, vstar - value);\n-\t\tstrbuf_add(&sb, name + klen, namelen - klen - ksuffixlen);\n+\t\t\tdie(_(\"replacement '%s' has no '*'\"), replacement);\n+\t\tstrbuf_add(&sb, replacement, vstar - replacement);\n+\t\tstrbuf_add(&sb, refname + klen, namelen - klen - ksuffixlen);\n \t\tstrbuf_addstr(&sb, vstar + 1);\n \t\t*result = strbuf_detach(&sb, NULL);\n \t}\n@@ -301,7 +301,7 @@ static int refspec_match(const struct refspec_item *refspec,\n \t\t\t const char *name)\n {\n \tif (refspec->pattern)\n-\t\treturn match_name_with_pattern(refspec->src, name, NULL, NULL);\n+\t\treturn match_refname_with_pattern(refspec->src, name, NULL, NULL);\n \n \treturn !strcmp(refspec->src, name);\n }\n@@ -352,7 +352,7 @@ static int refspec_find_negative_match(struct refspec *rs, struct refspec_item *\n \t\t\tconst char *key = refspec->dst ? refspec->dst : refspec->src;\n \t\t\tconst char *value = refspec->src;\n \n-\t\t\tif (match_name_with_pattern(key, needle, value, &expn_name))\n+\t\t\tif (match_refname_with_pattern(key, needle, value, &expn_name))\n \t\t\t\tstring_list_append_nodup(&reversed, expn_name);\n \t\t} else if (refspec->matching) {\n \t\t\t/* For the special matching refspec, any query should match */\n@@ -397,7 +397,7 @@ void refspec_find_all_matches(struct refspec *rs,\n \t\tif (!refspec->dst || refspec->negative)\n \t\t\tcontinue;\n \t\tif (refspec->pattern) {\n-\t\t\tif (match_name_with_pattern(key, needle, value, result))\n+\t\t\tif (match_refname_with_pattern(key, needle, value, result))\n \t\t\t\tstring_list_append_nodup(results, *result);\n \t\t} else if (!strcmp(needle, key)) {\n \t\t\tstring_list_append(results, value);\n@@ -426,7 +426,7 @@ int refspec_find_match(struct refspec *rs, struct refspec_item *query)\n \t\tif (!refspec->dst || refspec->negative)\n \t\t\tcontinue;\n \t\tif (refspec->pattern) {\n-\t\t\tif (match_name_with_pattern(key, needle, value, result)) {\n+\t\t\tif (match_refname_with_pattern(key, needle, value, result)) {\n \t\t\t\tquery->force = refspec->force;\n \t\t\t\treturn 0;\n \t\t\t}\ndiff --git a/refspec.h b/refspec.h\nindex f62f83a7ee..e2b5cc54ef 100644\n--- a/refspec.h\n+++ b/refspec.h\n@@ -75,11 +75,12 @@ void refspec_ref_prefixes(const struct refspec *rs,\n int refname_matches_negative_refspec_item(const char *refname, struct refspec *rs);\n \n /*\n- * Checks whether a name matches a pattern and optionally generates a result.\n- * Returns 1 if the name matches the pattern, 0 otherwise.\n+ * Checks if a refname matches a globbing refspec pattern.\n+ * If replacement is provided, computes the corresponding mapped refname.\n+ * Returns 1 if refname matches pattern, 0 otherwise.\n  */\n-int match_name_with_pattern(const char *key, const char *name,\n-\t\t\t\t   const char *value, char **result);\n+int match_refname_with_pattern(const char *pattern, const char *refname,\n+\t\t\t\t   const char *replacement, char **result);\n \n /*\n  * Queries a refspec for a match and updates the query item.\ndiff --git a/remote.c b/remote.c\nindex 5574b6a00f..5d3d1773dc 100644\n--- a/remote.c\n+++ b/remote.c\n@@ -1322,9 +1322,9 @@ static char *get_ref_match(const struct refspec *rs, const struct ref *ref,\n \t\t\tconst char *dst_side = item->dst ? item->dst : item->src;\n \t\t\tint match;\n \t\t\tif (direction == FROM_SRC)\n-\t\t\t\tmatch = match_name_with_pattern(item->src, ref->name, dst_side, &name);\n+\t\t\t\tmatch = match_refname_with_pattern(item->src, ref->name, dst_side, &name);\n \t\t\telse\n-\t\t\t\tmatch = match_name_with_pattern(dst_side, ref->name, item->src, &name);\n+\t\t\t\tmatch = match_refname_with_pattern(dst_side, ref->name, item->src, &name);\n \t\t\tif (match) {\n \t\t\t\tmatching_refs = i;\n \t\t\t\tbreak;\n@@ -1942,7 +1942,7 @@ static struct ref *get_expanded_map(const struct ref *remote_refs,\n \n \t\tif (strchr(ref->name, '^'))\n \t\t\tcontinue; /* a dereference item */\n-\t\tif (match_name_with_pattern(refspec->src, ref->name,\n+\t\tif (match_refname_with_pattern(refspec->src, ref->name,\n \t\t\t\t\t    refspec->dst, &expn_name) &&\n \t\t    !ignore_symref_update(expn_name, &scratch)) {\n \t\t\tstruct ref *cpy = copy_ref(ref);\n-- \n2.34.1\n\n"}]}