Commit Diff


commit - 0b819c411db361d628205284db65d324fa0f6811
commit + dd111f75ac7152b2586f2ded82db5e80083dda44
blob - 230993d12577872f9b3c09c52a605e9d0ee45bd5
blob + 2985ff9af0964756d55c68c19780d8b9c208370e
--- lib/pack_create.c
+++ lib/pack_create.c
@@ -1266,9 +1266,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;
 	}