Commit Diff


commit - 912a163eb6901d0a797d05fb21b34bc30031eb39
commit + 03c03172348b5f515b9ce884313118428a8674b5
blob - f72e0aef68bef2ed6581aa52ad094c2503f1da86
blob + 8a2f38c2fd49f037d68d024c2463fd01fd4231ba
--- lib/pack_create.c
+++ lib/pack_create.c
@@ -1267,9 +1267,20 @@ findtwixt(struct got_object_id ***res, int *nres, int 
 
 	for (i = 0; i < nhead; i++) {
 		struct got_object_id *id = head[i];
+		int j, color = COLOR_KEEP;
+
 		if (id == NULL)
 			continue;
-		err = queue_commit_or_tag_id(id, COLOR_KEEP, &ids, repo);
+
+		for (j = 0; j < ntail; j++) {
+			if (tail[j] != NULL &&
+			    got_object_id_cmp(id, tail[j]) == 0) {
+				color = COLOR_DROP;
+				break;
+			}
+		}
+
+		err = queue_commit_or_tag_id(id, color, &ids, repo);
 		if (err)
 			goto done;
 	}