Commit Diff


commit - 4788f1cebb9b14790dd4899b6f9007c721eec61e
commit + e6c1173dcf57c322cbb74af339c615c983c190f3
blob - 650dd1e206e344aa1713de7d98dc4dd57085dcc8
blob + 058e5043c887bbd0abf19e56bf3c6d7dfe952f16
--- libexec/got-index-pack/got-index-pack.c
+++ libexec/got-index-pack/got-index-pack.c
@@ -706,6 +706,13 @@ index_pack(struct got_pack *pack, int idxfd, FILE *tmp
 	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 &&