Commit fbafdecfb2616668a85d20ef641764749a229f7a

Stefan Sperling 2022-04-10T13:03:29

revert 03c03172 "drop a commit right away if it matches an excluded commit" This change resulted in a full history walk even when no objects will be added to the pack file. Fix this regression by reverting the change.

diff --git a/lib/pack_create.c b/lib/pack_create.c
index 5ad9119..b52856e 100644
--- a/lib/pack_create.c
+++ b/lib/pack_create.c
@@ -1357,20 +1357,9 @@ findtwixt(struct got_object_id ***res, int *nres, int *ncolored,
 
 	for (i = 0; i < nhead; i++) {
 		struct got_object_id *id = head[i];
-		int j, color = COLOR_KEEP;
-
 		if (id == NULL)
 			continue;
-
-		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);
+		err = queue_commit_or_tag_id(id, COLOR_KEEP, &ids, repo);
 		if (err)
 			goto done;
 	}