SVN.pm::parse_svn_date: allow timestamps with a single-digit hour
[gitweb.git] / builtin / pack-objects.c
index 4eb0521c815870abb670e8ddb035caa9c6507e67..ef1f20ea94ff9567d23f7cef5203020d9365d5bd 100644 (file)
@@ -38,17 +38,18 @@ struct object_entry {
        void *delta_data;       /* cached delta (uncompressed) */
        unsigned long delta_size;       /* delta data size (uncompressed) */
        unsigned long z_delta_size;     /* delta data size (compressed) */
-       unsigned int hash;      /* name hint hash */
        enum object_type type;
        enum object_type in_pack_type;  /* could be delta */
+       uint32_t hash;                  /* name hint hash */
        unsigned char in_pack_header_size;
-       unsigned char preferred_base; /* we do not pack this, but is available
-                                      * to be used as the base object to delta
-                                      * objects against.
-                                      */
-       unsigned char no_try_delta;
-       unsigned char tagged; /* near the very tip of refs */
-       unsigned char filled; /* assigned write-order */
+       unsigned preferred_base:1; /*
+                                   * we do not pack this, but is available
+                                   * to be used as the base object to delta
+                                   * objects against.
+                                   */
+       unsigned no_try_delta:1;
+       unsigned tagged:1; /* near the very tip of refs */
+       unsigned filled:1; /* assigned write-order */
 };
 
 /*
@@ -736,8 +737,6 @@ static void write_pack_file(void)
                        f = create_tmp_packfile(&pack_tmp_name);
 
                offset = write_pack_header(f, nr_remaining);
-               if (!offset)
-                       die_errno("unable to write pack header");
                nr_written = 0;
                for (; i < nr_objects; i++) {
                        struct object_entry *e = write_order[i];
@@ -859,9 +858,9 @@ static void rehash_objects(void)
        }
 }
 
-static unsigned name_hash(const char *name)
+static uint32_t name_hash(const char *name)
 {
-       unsigned c, hash = 0;
+       uint32_t c, hash = 0;
 
        if (!name)
                return 0;
@@ -908,7 +907,7 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
        struct packed_git *p, *found_pack = NULL;
        off_t found_offset = 0;
        int ix;
-       unsigned hash = name_hash(name);
+       uint32_t hash = name_hash(name);
 
        ix = nr_objects ? locate_object_entry_hash(sha1) : -1;
        if (ix >= 0) {
@@ -1000,7 +999,7 @@ static int pbase_tree_cache_ix_incr(int ix)
 static struct pbase_tree {
        struct pbase_tree *next;
        /* This is a phony "cache" entry; we are not
-        * going to evict it nor find it through _get()
+        * going to evict it or find it through _get()
         * mechanism -- this is for the toplevel node that
         * would almost always change with any commit.
         */
@@ -2031,7 +2030,7 @@ static int add_ref_tag(const char *path, const unsigned char *sha1, int flag, vo
 {
        unsigned char peeled[20];
 
-       if (!prefixcmp(path, "refs/tags/") && /* is a tag? */
+       if (starts_with(path, "refs/tags/") && /* is a tag? */
            !peel_ref(path, peeled)        && /* peelable? */
            locate_object_entry(peeled))      /* object packed? */
                add_object_entry(sha1, OBJ_TAG, NULL, 0);
@@ -2378,7 +2377,7 @@ static void get_object_list(int ac, const char **av)
 
        if (prepare_revision_walk(&revs))
                die("revision walk setup failed");
-       mark_edges_uninteresting(revs.commits, &revs, show_edge);
+       mark_edges_uninteresting(&revs, show_edge);
        traverse_commit_list(&revs, show_commit, show_object, NULL);
 
        if (keep_unreachable)