Commit Diff


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;