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 <jbowes@dangerouslyinc.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
James Bowes committed
May 29, 2007 at 19:29 UTC
1055880e7c096907ac87203dd83fdc6830251115
1 file changed
+5
-2
sha1_name.c
+5
-2
@@ -76,8 +76,11 @@ static int find_short_packed_object(int len, const unsigned char *match, unsigne
76
77
prepare_packed_git();
78
for (p = packed_git; p && found < 2; p = p->next) {
79
- uint32_t num = p->num_objects;
80
- uint32_t first = 0, last = num;
79
+ uint32_t num, last;
80
+ uint32_t first = 0;
81
+ open_pack_index(p);
82
+ num = p->num_objects;
83
+ last = num;
84
while (first < last) {
85
uint32_t mid = (first + last) / 2;
86
const unsigned char *now;