Commit Diff


commit - b2155b85a74362df960f36d6e1cadcdb62ce8fe9
commit + d37e5e854f34bf332a06ab4520ccde1d4cd453f6
blob - 426eb0fa2507914f0a3f09f194ef915d6bd120d3
blob + 5b85ac8573c3f6ead09a50e80a15af2e78d794dc
--- lib/pack_create.c
+++ lib/pack_create.c
@@ -1259,7 +1259,7 @@ findtwixt(struct got_object_id ***res, int *nres, int 
 	const struct got_error *err = NULL;
 	struct got_object_id_queue ids;
 	struct got_object_idset *keep, *drop, *skip = NULL;
-	int i, nkeep;
+	int i, nkeep, nqueued = 0;
 
 	STAILQ_INIT(&ids);
 	*res = NULL;
@@ -1289,6 +1289,7 @@ findtwixt(struct got_object_id ***res, int *nres, int 
 		err = queue_commit_or_tag_id(id, COLOR_KEEP, &ids, repo);
 		if (err)
 			goto done;
+		nqueued++;
 	}
 
 	for (i = 0; i < ntail; i++) {
@@ -1298,9 +1299,10 @@ findtwixt(struct got_object_id ***res, int *nres, int 
 		err = queue_commit_or_tag_id(id, COLOR_DROP, &ids, repo);
 		if (err)
 			goto done;
+		nqueued++;
 	}
 
-	err = got_pack_paint_commits(ncolored, &ids, nhead + ntail,
+	err = got_pack_paint_commits(ncolored, &ids, nqueued,
 	    keep, drop, skip, repo, progress_cb, progress_arg, rl,
 	    cancel_cb, cancel_arg);
 	if (err)