On 11/29/2021 5:25 PM, Taylor Blau wrote:
+static int dump_mtimes(struct packed_git *p)
nit: you return an int here so you can use it as an error code...
+{
+ uint32_t i;
+ if (load_pack_mtimes(p) < 0)
+ die("could not load pack .mtimes");
+
+ for (i = 0; i < p->num_objects; i++) {
+ struct object_id oid;
+ if (nth_packed_object_id(&oid, p, i) < 0)
+ die("could not load object id at position %"PRIu32, i);
+
+ printf("%s %"PRIu32"\n",
+ oid_to_hex(&oid), nth_packed_mtime(p, i));
+ }
+
+ return 0;
But always return 0 unless you die().
+ return p ? dump_mtimes(p) : 1;
It makes this line concise, I suppose.
Perhaps just use "return dump_mtimes(p)" and have dump_mtimes()
return 1 if the given pack is NULL?
Thanks,
-Stolee