diff options
| -rw-r--r-- | cgit.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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) |