commit 9ef13b9dd6819c0a0232d9824b0001cb05f881b2 from: Stefan Sperling via: Thomas Adam date: Fri Aug 15 14:42:43 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 - 9b526dc485a847d4ee78adea32f5cf95dc52d98a commit + 9ef13b9dd6819c0a0232d9824b0001cb05f881b2 blob - 940716523ea1934a2bf118f5c2d1da2a580dcd1e blob + 442322d43f7a00493deda810122decfe4bd4a90f --- libexec/got-read-pack/got-read-pack.c +++ libexec/got-read-pack/got-read-pack.c @@ -1795,6 +1795,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); @@ -1818,7 +1825,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;