]> granicus.if.org Git - cgit/commitdiff
Find the default branch based on the contents of the namespace
authorRichard Maw <richard.maw@gmail.com>
Sat, 25 Jun 2016 21:55:44 +0000 (22:55 +0100)
committerRichard Maw <richard.maw@gmail.com>
Wed, 13 Jul 2016 19:09:37 +0000 (20:09 +0100)
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>
cgit.c

diff --git a/cgit.c b/cgit.c
index d9fe2b9df1641902610bb3df9a850a92b7e00123..540200e01d93215910e7c759f0a169457f7e69ac 100644 (file)
--- 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