aboutsummaryrefslogtreecommitdiff
path: root/shared.c
diff options
from:
to:
context:
space:
mode:
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index a39394d..e79c3da 100644
--- a/shared.c
+++ b/shared.c
@@ -13,6 +13,18 @@
struct cgit_repolist cgit_repolist;
struct cgit_context ctx;
+/* Returns true when the git repository belonging to this request was opened
+ * successfully. Some requests print a page for a repository which could not
+ * be opened, e.g. because repo.path is wrong, and the object database and
+ * ref stores must not be touched in that case: they would abort with
+ * "reference backend is unknown" or dereference the not yet known hash
+ * algorithm.
+ */
+int cgit_have_repository(void)
+{
+ return startup_info->have_repository;
+}
+
int chk_zero(int result, char *msg)
{
if (result != 0)