X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/c8ea73caabcb16ffb74baa70d35650027ed772c4..5293c8b7992bf3211b6bde7acbbd4e74ffd926d4:/ui-repolist.c?ds=sidebyside diff --git a/ui-repolist.c b/ui-repolist.c index e138f59..f21d28d 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -45,12 +45,22 @@ 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); - if (stat(path, &s) == 0) + path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch ? + repo->defbranch : "master"); + if (stat(path, &s) == 0) { *mtime = s.st_mtime; - else - *mtime = 0; + r->mtime = *mtime; + return 1; + } + + path = fmt("%s/%s", repo->path, "packed-refs"); + if (stat(path, &s) == 0) { + *mtime = s.st_mtime; + r->mtime = *mtime; + return 1; + } + *mtime = 0; r->mtime = *mtime; return (r->mtime != 0); }