aboutsummaryrefslogtreecommitdiff
path: root/ui-commit.h
diff options
from:
to:
context:
space:
mode:
authorGravatar Saya Andy <saya.andy@posteo.com> 2026-07-30 12:23:33 +0700
committerGravatar Saya Andy <saya.andy@posteo.com> 2026-07-30 12:23:33 +0700
commit26fbed3bc58600adc092ab41e094e0fcae60f3b2 (patch)
tree057b66b3fdad46810ef21e243ce50d18dbc81e9c /ui-commit.h
parent8c1df01ecea5b684dd420bcd5b4e4e25e56c3af8 (diff)
downloadcgitext-26fbed3bc58600adc092ab41e094e0fcae60f3b2.tar.gz
cgitext-26fbed3bc58600adc092ab41e094e0fcae60f3b2.zip
cgit: don't initialize notes when there is no repository
prepare_repo_env() calls load_display_notes() unconditionally, even when setup_git_directory_gently() has just reported that repo.path is not a repository. init_notes() then resolves the default notes ref and dereferences the repository's hash algorithm, which is still NULL: EXC_BAD_ACCESS (code=1, address=0x18) get_oid_basic(str="refs/notes/commits", len=18) at object-name.c:688 -> if (len == r->hash_algo->hexsz && !get_oid_hex(str, oid)) { A typo in repo.path therefore took out the request. On Linux this segfaults; on macOS nothing consumes the Mach exception, so the faulting instruction is retried forever and the worker process spins at 100% CPU instead of dying. Only load the notes once a repository has been opened. prepare_repo_cmd() reports the failure immediately afterwards, so such a request now renders "Failed to open <repo>: No such file or directory". Signed-off-by: Saya Andy <saya.andy@posteo.com>
Diffstat (limited to 'ui-commit.h')
0 files changed, 0 insertions, 0 deletions