diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cgit.c14
1 file changed, 8 insertions, 6 deletions
diff --git a/source/cgit.c b/source/cgit.c
index eb13709..5b26137 100644
--- a/source/cgit.c
+++ b/source/cgit.c
@@ -1033,7 +1033,10 @@ static void prepare_repo_env(int *nongit)
setenv("GIT_DIR", ctx.repo->path, 1);
setup_git_directory_gently(the_repository, nongit);
- load_display_notes(NULL);
+ // Notes come out of the object store, which a repository that failed
+ // to open has none of.
+ if (!*nongit)
+ load_display_notes(NULL);
}
/*
@@ -1050,11 +1053,10 @@ static int prepare_repo_cmd(int nongit)
err = errno;
ctx.page.title = cgit_fmtalloc("%s - %s", ctx.cfg.root_title, "config error");
ctx.repo = NULL;
- cgit_print_http_headers();
- cgit_print_docstart();
- cgit_print_pageheader();
- cgit_print_error("Failed to open %s: %s", name, err ? strerror(err) : "Not a valid git repository");
- cgit_print_docend();
+ cgit_print_error_page(
+ 404, "Not Found", "Failed to open %s: %s", name,
+ err ? strerror(err) : "Not a valid git repository"
+ );
return 1;
}
ctx.page.title = cgit_fmtalloc("%s - %s", ctx.repo->name, ctx.repo->desc);