From: James Bowes Date: Tue, 29 May 2007 23:29:51 +0000 (-0400) Subject: rev-parse: Identify short sha1 sums correctly. X-Git-Tag: v1.5.3-rc0~171^2~4 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1055880e7c096907ac87203dd83fdc6830251115;p=git.git rev-parse: Identify short sha1 sums correctly. find_short_packed_object was not loading the pack index files. Teach it to do so. Signed-off-by: James Bowes Signed-off-by: Junio C Hamano --- diff --git a/sha1_name.c b/sha1_name.c index 8dfceb2d7..7df01af78 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -76,8 +76,11 @@ static int find_short_packed_object(int len, const unsigned char *match, unsigne prepare_packed_git(); for (p = packed_git; p && found < 2; p = p->next) { - uint32_t num = p->num_objects; - uint32_t first = 0, last = num; + uint32_t num, last; + uint32_t first = 0; + open_pack_index(p); + num = p->num_objects; + last = num; while (first < last) { uint32_t mid = (first + last) / 2; const unsigned char *now;