git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rev-parse: Identify short sha1 sums correctly.
@ 2007-05-29 23:29 James Bowes
  2007-05-30  0:53 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: James Bowes @ 2007-05-29 23:29 UTC (permalink / raw)
  To: git, junkio

find_short_packed_object was not loading the pack index files.
Teach it to do so.

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
---
 sha1_name.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/sha1_name.c b/sha1_name.c
index 8dfceb2..7df01af 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;
-- 
1.5.2.869.g6b3ba

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-30  2:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1180478596243-git-send-email-jbowes@dangerouslyinc.com>
2007-05-29 23:40 ` [PATCH] rev-parse: Identify short sha1 sums correctly Junio C Hamano
2007-05-30  1:58   ` Shawn O. Pearce
2007-05-30  2:02   ` Shawn O. Pearce
2007-05-29 23:29 James Bowes
2007-05-30  0:53 ` Junio C Hamano
2007-05-30  1:09   ` James Bowes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).