commit - 5a19274d1f2108d99b338f96e8e397bc897be063
commit + 8bdc30366cc048d3406c876b14674f5bc1dfea94
blob - 64e555ba01c233deabfb7105c5e8a10004a56985
blob + 65325cf16f6257d3decf9839194c56965df6ef68
--- lib/pack_create.c
+++ lib/pack_create.c
if (err)
return err;
- STAILQ_INSERT_TAIL(ids, qid, entry);
+ if (color == COLOR_KEEP)
+ STAILQ_INSERT_TAIL(ids, qid, entry);
+ else
+ STAILQ_INSERT_HEAD(ids, qid, entry);
return got_pack_paint_commit(qid, color);
}
goto done;
}
- for (i = 0; i < nhead; i++) {
- struct got_object_id *id = head[i];
+ for (i = 0; i < ntail; i++) {
+ struct got_object_id *id = tail[i];
if (id == NULL)
continue;
- err = queue_commit_or_tag_id(id, COLOR_KEEP, &ids, repo);
+ err = queue_commit_or_tag_id(id, COLOR_DROP, &ids, repo);
if (err)
goto done;
nqueued++;
}
- for (i = 0; i < ntail; i++) {
- struct got_object_id *id = tail[i];
+ for (i = 0; i < nhead; i++) {
+ struct got_object_id *id = head[i];
if (id == NULL)
continue;
- err = queue_commit_or_tag_id(id, COLOR_DROP, &ids, repo);
+ err = queue_commit_or_tag_id(id, COLOR_KEEP, &ids, repo);
if (err)
goto done;
nqueued++;
blob - ec345e5b6a00f849b5cfb2a76e633b05d6215588
blob + 41a731141127c4661782ab267c82e08033542cc1
--- libexec/got-read-pack/got-read-pack.c
+++ libexec/got-read-pack/got-read-pack.c
return err;
memcpy(&qid->id, id, sizeof(qid->id));
- STAILQ_INSERT_TAIL(ids, qid, entry);
+ if (color == COLOR_KEEP)
+ STAILQ_INSERT_TAIL(ids, qid, entry);
+ else
+ STAILQ_INSERT_HEAD(ids, qid, entry);
return paint_commit(qid, color);
}