Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Explain the notes setup in one comment
-rw-r--r--source/cgit.c7
1 file changed, 3 insertions, 4 deletions
diff --git a/source/cgit.c b/source/cgit.c
index fd2a17a..faf5ab8 100644
--- a/source/cgit.c
+++ b/source/cgit.c
@@ -1046,14 +1046,13 @@ static void prepare_repo_env(int *nongit, int *err)
setup_git_directory_gently(the_repository, nongit);
*err = errno;
// Notes come out of the object store, which a repository that failed
- // to open has none of, and git dies loading a notes ref that names
- // no tree, so such a ref is passed over.
+ // to open has none of. The commit and log pages always ask for them,
+ // so they are set up either way, but a default ref that names no tree
+ // is left out, since git dies loading one.
if (!*nongit) {
struct display_notes_opt opt;
char *ref = default_notes_ref(the_repository);
- // The notes are always set up, since the commit and log pages
- // ask for them, only with no ref when the default names no tree.
init_display_notes(&opt);
opt.use_default_notes = cgit_notes_ref_usable(ref);
load_display_notes(&opt);