diff options
Diffstat (limited to '')
| -rw-r--r-- | source/ui-repolist.c | 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 3 insertions, 1 deletion
diff --git a/source/ui-repolist.c b/source/ui-repolist.c index 24d5479..58e31ed 100644 --- a/source/ui-repolist.c +++ b/source/ui-repolist.c @@ -56,8 +56,10 @@ static const char *tip_branch(const struct cgit_repo *repo, struct strbuf *head) struct strbuf path = STRBUF_INIT; const char *branch = repo->defbranch; + // A scanned repository sets its own defbranch, which is stat'ed below + // the repository, so it is held to what a ref name may hold. if (branch) - return branch; + return check_refname_format(branch, REFNAME_ALLOW_ONELEVEL) ? "master" : branch; strbuf_addf(&path, "%s/HEAD", repo->path); if (strbuf_read_file(head, path.buf, 0) > 0) { |
