diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Pass over a notes ref that names no tree
A pusher can point refs/notes/commits or a signature notes ref at any
object, and git dies loading one that is no tree, which ended every page
of the repository, the dumb transport included. Such a ref now counts
as absent.
Diffstat (limited to 'source/cgit.c')
| -rw-r--r-- | source/cgit.c | 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 14 insertions, 3 deletions
diff --git a/source/cgit.c b/source/cgit.c index 2ef4cf1..8a3d8c1 100644 --- a/source/cgit.c +++ b/source/cgit.c @@ -1098,9 +1098,20 @@ 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. - if (!*nongit) - load_display_notes(NULL); + // to open has none of, and git dies loading a notes ref that names + // no tree, so such a ref is passed over. + 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); + release_display_notes(&opt); + free(ref); + } } /* |
