refs: drop strbuf_ prefix from helpers

The helper functions (strbuf_branchname, strbuf_check_branch_ref,
and strbuf_check_tag_ref) are about handling branch and tag names,
and it is a non-essential fact that these functions use strbuf to
hold these names.  Rename them to make it clarify that these are
more about "ref".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano
2024-12-03 11:32:38 +09:00
parent 5bcbde9e49
commit 93e5e048f8
10 changed files with 23 additions and 23 deletions

8
refs.c
View File

@ -697,7 +697,7 @@ static char *substitute_branch_name(struct repository *r,
return NULL;
}
void strbuf_branchname(struct strbuf *sb, const char *name, unsigned allowed)
void copy_branchname(struct strbuf *sb, const char *name, unsigned allowed)
{
int len = strlen(name);
struct interpret_branch_name_options options = {
@ -711,10 +711,10 @@ void strbuf_branchname(struct strbuf *sb, const char *name, unsigned allowed)
strbuf_add(sb, name + used, len - used);
}
int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
int check_branch_ref(struct strbuf *sb, const char *name)
{
if (startup_info->have_repository)
strbuf_branchname(sb, name, INTERPRET_BRANCH_LOCAL);
copy_branchname(sb, name, INTERPRET_BRANCH_LOCAL);
else
strbuf_addstr(sb, name);
@ -733,7 +733,7 @@ int strbuf_check_branch_ref(struct strbuf *sb, const char *name)
return check_refname_format(sb->buf, 0);
}
int strbuf_check_tag_ref(struct strbuf *sb, const char *name)
int check_tag_ref(struct strbuf *sb, const char *name)
{
if (name[0] == '-')
return -1;