Merge branch 'jc/allow-ff-merging-kept-tags' into next
[gitweb.git] / packfile.c
index 860e6d7fe4d0d115b0b635599271f302c5bedb69..5d07f330c8a4bf0a748e3fc87ed70f5affafd681 100644 (file)
@@ -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;
 }