summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@gmail.com>2016-06-25 21:55:44 (GMT)
committerRichard Maw <richard.maw@gmail.com>2016-07-13 19:09:37 (GMT)
commitf1984bb2367c14ca86a6afbdd87fa6280cd1162b (patch)
tree76ebbd59b9eeced9606c7e6df25992b2a335067b
parent5817a8f70370c0d41950fb2e7516389866da89b7 (diff)
downloadcgit-f1984bb2367c14ca86a6afbdd87fa6280cd1162b.zip
cgit-f1984bb2367c14ca86a6afbdd87fa6280cd1162b.tar.gz
cgit-f1984bb2367c14ca86a6afbdd87fa6280cd1162b.tar.bz2
Find the default branch based on the contents of the namespace
The find_current_ref callback does not need to be modified to strip off the namespace prefix, since the for_each_ref functions don't include the base ref prefix. Signed-off-by: Richard Maw <richard.maw@gmail.com>
-rw-r--r--cgit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cgit.c b/cgit.c
index d9fe2b9..540200e 100644
--- a/cgit.c
+++ b/cgit.c
@@ -458,7 +458,7 @@ static char *find_default_branch(struct cgit_repo *repo)
info.req_ref = repo->defbranch;
info.first_ref = NULL;
info.match = 0;
- for_each_branch_ref(find_current_ref, &info);
+ cgit_for_each_namespaced_ref_in("refs/heads/", find_current_ref, &info);
if (info.match)
ref = info.req_ref;
else