mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user