From 8a7aa400143f3e95b3ecd18f19e21b526d6a419d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 19:47:34 -1000 Subject: Read the description file without repo.desc Only a scanned repository fell back to its description file, so one listed in cgitrc without repo.desc showed "[no description]" however its file read. repo.desc may follow repo.path, so the file is read where a page shows the description, which also spares every other request the reads. --- source/shared.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/shared.h') diff --git a/source/shared.h b/source/shared.h index 302b752..f182962 100644 --- a/source/shared.h +++ b/source/shared.h @@ -74,6 +74,14 @@ extern char *cgit_trim_end(const char *str, char c); extern int cgit_read_first_line(const char *path, char **buf); extern char *cgit_strdup_first_line(const char *text); +/* + * Give a repository that cgitrc left without a description the first line of + * the description file git keeps in it, unless that is still git's + * placeholder. Pages call it only for the repositories they show, so a request + * reads no more of these files than it needs. + */ +extern void cgit_read_repo_desc(struct cgit_repo *repo); + /* * How many bytes the UTF-8 sequence at p holds, or 0 when it is invalid, * looking at most left bytes ahead. -- cgit 2.12.1