aboutsummaryrefslogtreecommitdiff
diff options
from:
to:
context:
space:
mode:
-rw-r--r--cgit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cgit.c b/cgit.c
index ca318e8..5bf52f8 100644
--- a/cgit.c
+++ b/cgit.c
@@ -587,9 +587,12 @@ static void prepare_repo_env(int *nongit)
/* Setup the git directory and initialize the notes system. Both of these
* load local configuration from the git repository, so we do them both while
- * the HOME variables are unset. */
+ * the HOME variables are unset. Initializing the notes system requires an
+ * actual repository, as it would otherwise dereference the not yet known
+ * hash algorithm. */
setup_git_directory_gently(nongit);
- load_display_notes(NULL);
+ if (!*nongit)
+ load_display_notes(NULL);
}
static int prepare_repo_cmd(int nongit)