X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/03eb76dfad2887127581f5f1b4e2edbe8c4ca5fe..3cb5d86dc68bab4883bf5a7cbc90f3e266237355:/ui-summary.c diff --git a/ui-summary.c b/ui-summary.c index f965b32..abf914e 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -108,7 +108,12 @@ void cgit_print_repo_readme(char *path) colon = strchr(ctx.repo->readme, ':'); if (colon && strlen(colon) > 1) { *colon = '\0'; - ref = ctx.repo->readme; + /* If it starts with a colon, we want to use + * the default branch */ + if (colon == ctx.repo->readme && ctx.repo->defbranch) + ref = ctx.repo->defbranch; + else + ref = ctx.repo->readme; ctx.repo->readme = colon + 1; if (!(*ctx.repo->readme)) return;