Merge branch 'nd/parseopt-completion' into next
[gitweb.git] / packfile.c
index 860e6d7fe4d0d115b0b635599271f302c5bedb69..7c1a2519fcb9c45aacf5481811bc26f44736de59 100644 (file)
@@ -1361,16 +1361,16 @@ int packed_object_info(struct packed_git *p, off_t obj_offset,
                *oi->disk_sizep = revidx[1].offset - obj_offset;
        }
 
-       if (oi->typep || oi->typename) {
+       if (oi->typep || oi->type_name) {
                enum object_type ptot;
                ptot = packed_to_object_type(p, obj_offset, type, &w_curs,
                                             curpos);
                if (oi->typep)
                        *oi->typep = ptot;
-               if (oi->typename) {
-                       const char *tn = typename(ptot);
+               if (oi->type_name) {
+                       const char *tn = type_name(ptot);
                        if (tn)
-                               strbuf_addstr(oi->typename, tn);
+                               strbuf_addstr(oi->type_name, tn);
                }
                if (ptot < 0) {
                        type = OBJ_BAD;
@@ -1723,7 +1723,7 @@ off_t find_pack_entry_one(const unsigned char *sha1,
        const uint32_t *level1_ofs = p->index_data;
        const unsigned char *index = p->index_data;
        unsigned stride;
-       int ret;
+       uint32_t result;
 
        if (!index) {
                if (open_pack_index(p))
@@ -1743,9 +1743,8 @@ off_t find_pack_entry_one(const unsigned char *sha1,
                index += 4;
        }
 
-       ret = bsearch_hash(sha1, level1_ofs, index, stride);
-       if (ret >= 0)
-               return nth_packed_object_offset(p, ret);
+       if (bsearch_hash(sha1, level1_ofs, index, stride, &result))
+               return nth_packed_object_offset(p, result);
        return 0;
 }