commit 106bfc0e078584381c4fe0789d54d72972bec3bd from: Stefan Sperling date: Thu Aug 14 16:45:14 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. ok op@ commit - b46b8f09728040b4d8ff7a93ea5236b90412f768 commit + 106bfc0e078584381c4fe0789d54d72972bec3bd 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;