document why deltas will usually be resolved within a single loop iteration
diff --git a/libexec/got-index-pack/got-index-pack.c b/libexec/got-index-pack/got-index-pack.c
index 650dd1e..058e504 100644
--- a/libexec/got-index-pack/got-index-pack.c
+++ b/libexec/got-index-pack/got-index-pack.c
@@ -706,6 +706,13 @@ index_pack(struct got_pack *pack, int idxfd, FILE *tmpfile,
pass++;
while (nvalid != nobj) {
int n = 0;
+ /*
+ * This loop will only run once unless the pack file
+ * contains ref deltas which refer to objects located
+ * later in the pack file, which is unusual.
+ * Offset deltas can always be resolved in one pass
+ * unless the packfile is corrupt.
+ */
for (i = 0; i < nobj; i++) {
obj = &objects[i];
if (obj->type != GOT_OBJ_TYPE_REF_DELTA &&