aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/tag.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-03 11:32:37 +0900
committerJunio C Hamano <gitster@pobox.com>2024-12-03 12:38:49 +0900
commit5bcbde9e49c14f4e47a0ed5fc60470f3d4447efd (patch)
tree517f00998353e4a7670be3457d1b91f3dba2a548 /builtin/tag.c
parentGit 2.47.1 (diff)
downloadgit-5bcbde9e49c14f4e47a0ed5fc60470f3d4447efd.tar.gz
git-5bcbde9e49c14f4e47a0ed5fc60470f3d4447efd.zip
refs: move ref name helpers around
strbuf_branchname(), strbuf_check_{branch,tag}_ref() are helper functions to deal with branch and tag names, and the fact that they happen to use strbuf to hold the name of a branch or a tag is not essential. These functions fit better in the refs API than strbuf API, the latter of which is about string manipulations. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/tag.c')
-rw-r--r--builtin/tag.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/builtin/tag.c b/builtin/tag.c
index 93d10d5915..8279dccbe0 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -447,17 +447,6 @@ static int parse_msg_arg(const struct option *opt, const char *arg, int unset)
return 0;
}
-static int strbuf_check_tag_ref(struct strbuf *sb, const char *name)
-{
- if (name[0] == '-')
- return -1;
-
- strbuf_reset(sb);
- strbuf_addf(sb, "refs/tags/%s", name);
-
- return check_refname_format(sb->buf, 0);
-}
-
int cmd_tag(int argc,
const char **argv,
const char *prefix,