diff options
-rw-r--r-- | cgit.h | 2 | ||||
-rw-r--r-- | shared.c | 10 |
2 files changed, 12 insertions, 0 deletions
@@ -394,4 +394,6 @@ extern char *get_mimetype_for_filename(const char *filename); extern int cgit_get_sha1(const char *name, unsigned char *sha1); +extern int cgit_for_each_namespaced_ref_in(const char *prefix, each_ref_fn fn, void *cb_data); + #endif /* CGIT_H */ @@ -651,3 +651,13 @@ int cgit_get_sha1(const char *name, unsigned char *sha1) return get_sha1(name, sha1); } } + +int cgit_for_each_namespaced_ref_in(const char *prefix, each_ref_fn fn, void *cb_data) +{ + struct strbuf strbuf = STRBUF_INIT; + int ret; + strbuf_addf(&strbuf, "%s%s", get_git_namespace(), prefix); + ret = for_each_ref_in(strbuf.buf, fn, cb_data); + strbuf_release(&strbuf); + return ret; +} |