From 93e5e048f84138a632b239632c9b45ae238cdf1c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 3 Dec 2024 11:32:38 +0900 Subject: 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 --- refs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'refs.c') diff --git a/refs.c b/refs.c index 59a9223d4c..a24bfe3845 100644 --- a/refs.c +++ b/refs.c @@ -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; -- cgit v1.2.3