Skip to content

Commit

Permalink
rev-parse: Identify short sha1 sums correctly.
Browse files Browse the repository at this point in the history
find_short_packed_object was not loading the pack index files.
Teach it to do so.

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
James Bowes authored and Junio C Hamano committed May 30, 2007
1 parent 693d2bc commit 1055880
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sha1_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1055880

Please sign in to comment.