diff options
Diffstat (limited to 'libbb/strbuf.c')
-rw-r--r-- | libbb/strbuf.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/libbb/strbuf.c b/libbb/strbuf.c index a88496030..d98b0fd41 100644 --- a/libbb/strbuf.c +++ b/libbb/strbuf.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "cache.h" | 1 | #include "libbb.h" |
2 | #include "refs.h" | 2 | #include "strbuf.h" |
3 | #include "git.h" | ||
3 | 4 | ||
4 | int prefixcmp(const char *str, const char *prefix) | 5 | int prefixcmp(const char *str, const char *prefix) |
5 | { | 6 | { |
@@ -358,19 +359,3 @@ int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint) | |||
358 | 359 | ||
359 | return len; | 360 | return len; |
360 | } | 361 | } |
361 | |||
362 | int strbuf_branchname(struct strbuf *sb, const char *name) | ||
363 | { | ||
364 | int len = strlen(name); | ||
365 | if (interpret_branch_name(name, sb) == len) | ||
366 | return 0; | ||
367 | strbuf_add(sb, name, len); | ||
368 | return len; | ||
369 | } | ||
370 | |||
371 | int strbuf_check_branch_ref(struct strbuf *sb, const char *name) | ||
372 | { | ||
373 | strbuf_branchname(sb, name); | ||
374 | strbuf_splice(sb, 0, 0, "refs/heads/", 11); | ||
375 | return check_ref_format(sb->buf); | ||
376 | } | ||