diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-12-03 11:32:37 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-12-03 12:38:49 +0900 |
| commit | 5bcbde9e49c14f4e47a0ed5fc60470f3d4447efd (patch) | |
| tree | 517f00998353e4a7670be3457d1b91f3dba2a548 /strbuf.h | |
| parent | Git 2.47.1 (diff) | |
| download | git-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 'strbuf.h')
| -rw-r--r-- | strbuf.h | 22 |
1 files changed, 0 insertions, 22 deletions
@@ -637,28 +637,6 @@ static inline void strbuf_complete_line(struct strbuf *sb) strbuf_complete(sb, '\n'); } -/* - * Copy "name" to "sb", expanding any special @-marks as handled by - * repo_interpret_branch_name(). The result is a non-qualified branch name - * (so "foo" or "origin/master" instead of "refs/heads/foo" or - * "refs/remotes/origin/master"). - * - * Note that the resulting name may not be a syntactically valid refname. - * - * If "allowed" is non-zero, restrict the set of allowed expansions. See - * repo_interpret_branch_name() for details. - */ -void strbuf_branchname(struct strbuf *sb, const char *name, - unsigned allowed); - -/* - * Like strbuf_branchname() above, but confirm that the result is - * syntactically valid to be used as a local branch name in refs/heads/. - * - * The return value is "0" if the result is valid, and "-1" otherwise. - */ -int strbuf_check_branch_ref(struct strbuf *sb, const char *name); - typedef int (*char_predicate)(char ch); void strbuf_addstr_urlencode(struct strbuf *sb, const char *name, |
