]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-repolist.c
ui-repolist.c: fallback to "master" if no default branch is specified
[ps-cgit] / ui-repolist.c
index dce2eacbbb750779b9eae7d2889fe48051960937..f21d28d5bc5b5f41207530bd5111553377735cc0 100644 (file)
@@ -45,7 +45,8 @@ static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime)
                return 1;
        }
 
-       path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch);
+       path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch ?
+                  repo->defbranch : "master");
        if (stat(path, &s) == 0) {
                *mtime = s.st_mtime;
                r->mtime = *mtime;
@@ -300,7 +301,7 @@ void cgit_print_site_readme()
        if (!ctx.cfg.root_readme)
                return;
        if (ctx.cfg.about_filter)
-               cgit_open_filter(ctx.cfg.about_filter, NULL);
+               cgit_open_filter(ctx.cfg.about_filter);
        html_include(ctx.cfg.root_readme);
        if (ctx.cfg.about_filter)
                cgit_close_filter(ctx.cfg.about_filter);