log: handle integer overflow in timestamps
[gitweb.git] / pack-refs.c
index f09a05422854c919cd31c542b82b057624275959..4461f71a37bea5d935409761cc8a838bff443439 100644 (file)
@@ -27,6 +27,7 @@ static int handle_one_ref(const char *path, const unsigned char *sha1,
                          int flags, void *cb_data)
 {
        struct pack_refs_cb_data *cb = cb_data;
+       struct object *o;
        int is_tag_ref;
 
        /* Do not pack the symbolic refs */
@@ -39,14 +40,13 @@ static int handle_one_ref(const char *path, const unsigned char *sha1,
                return 0;
 
        fprintf(cb->refs_file, "%s %s\n", sha1_to_hex(sha1), path);
-       if (is_tag_ref) {
-               struct object *o = parse_object(sha1);
-               if (o->type == OBJ_TAG) {
-                       o = deref_tag(o, path, 0);
-                       if (o)
-                               fprintf(cb->refs_file, "^%s\n",
-                                       sha1_to_hex(o->sha1));
-               }
+
+       o = parse_object_or_die(sha1, path);
+       if (o->type == OBJ_TAG) {
+               o = deref_tag(o, path, 0);
+               if (o)
+                       fprintf(cb->refs_file, "^%s\n",
+                               sha1_to_hex(o->sha1));
        }
 
        if ((cb->flags & PACK_REFS_PRUNE) && !do_not_prune(flags)) {
@@ -128,7 +128,7 @@ int pack_refs(unsigned int flags)
                die_errno("unable to create ref-pack file structure");
 
        /* perhaps other traits later as well */
-       fprintf(cbdata.refs_file, "# pack-refs with: peeled \n");
+       fprintf(cbdata.refs_file, "# pack-refs with: peeled fully-peeled \n");
 
        for_each_ref(handle_one_ref, &cbdata);
        if (ferror(cbdata.refs_file))