diff options
| author | Meet Soni <meetsoni3017@gmail.com> | 2025-02-15 14:15:39 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-02-18 09:44:27 -0800 |
| commit | 044b6f04f23d6c7e3c3750c9829db96b71470874 (patch) | |
| tree | 2732b18fd48c7aea09e8e299cc840d4ee8ccf46e /refspec.h | |
| parent | 03944513488db4a81fdb4c21c3b515e4cb260b05 (diff) | |
| download | git-044b6f04f23d6c7e3c3750c9829db96b71470874.tar.gz | |
refspec: clarify function naming and documentation
Rename `match_name_with_pattern()` to `match_refname_with_pattern()` to
better reflect its purpose and improve documentation comment clarity.
The previous function name and parameter names were inconsistent, making
it harder to understand their roles in refspec matching.
- Rename parameters:
- `key` -> `pattern` (globbing pattern to match)
- `name` -> `refname` (refname to check)
- `value` -> `replacement` (replacement mapping pattern)
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refspec.h')
| -rw-r--r-- | refspec.h | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -75,11 +75,12 @@ void refspec_ref_prefixes(const struct refspec *rs, int refname_matches_negative_refspec_item(const char *refname, struct refspec *rs); /* - * Checks whether a name matches a pattern and optionally generates a result. - * Returns 1 if the name matches the pattern, 0 otherwise. + * Checks if a refname matches a globbing refspec pattern. + * If replacement is provided, computes the corresponding mapped refname. + * Returns 1 if refname matches pattern, 0 otherwise. */ -int match_name_with_pattern(const char *key, const char *name, - const char *value, char **result); +int match_refname_with_pattern(const char *pattern, const char *refname, + const char *replacement, char **result); /* * Queries a refspec for a match and updates the query item. |
