commit c5dfdea5d3d15ba10bb5358e6bd4c2d252a62650 from: Stefan Sperling date: Wed Aug 13 12:46:50 2025 UTC do not let got-read-pack paint parent commits which are not in its pack file If any parent commit of the current commit is missing, stop iterating and return control to the main process. Fixes a case where offloading to got-read-pack resulted in an effectively endless loop. commit - 4a35cea75fd93db39197367750ad136b3ee5ee7a commit + c5dfdea5d3d15ba10bb5358e6bd4c2d252a62650 blob - 4e65a3f8939e6541fe568b471a16f36581536485 blob + 21cff52d4c0895389b584790bfbe4f39a23dbf99 --- libexec/got-read-pack/got-read-pack.c +++ libexec/got-read-pack/got-read-pack.c @@ -1798,6 +1798,13 @@ paint_commits(struct got_object_id_queue *ids, int *ni parents = got_object_commit_get_parent_ids(commit); if (parents) { struct got_object_qid *pid; + + STAILQ_FOREACH(pid, parents, entry) { + if (got_packidx_get_object_idx(packidx, + &pid->id) == -1) + goto send; + } + color = (intptr_t)qid->data; STAILQ_FOREACH(pid, parents, entry) { err = queue_commit_id(ids, &pid->id, color); @@ -1821,7 +1828,7 @@ paint_commits(struct got_object_id_queue *ids, int *ni if (err) goto done; } - +send: err = got_privsep_send_painted_commits(ibuf, &painted, &npainted, 1, 1); if (err) goto done;