All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bowes <jbowes@dangerouslyinc.com>
To: git@vger.kernel.org, junkio@cox.net
Subject: [PATCH] rev-parse: Identify short sha1 sums correctly.
Date: Tue, 29 May 2007 19:29:51 -0400	[thread overview]
Message-ID: <1180481391179-git-send-email-jbowes@dangerouslyinc.com> (raw)

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

             reply	other threads:[~2007-05-29 23:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-29 23:29 James Bowes [this message]
2007-05-30  0:53 ` [PATCH] rev-parse: Identify short sha1 sums correctly Junio C Hamano
2007-05-30  1:09   ` James Bowes
     [not found] <1180478596243-git-send-email-jbowes@dangerouslyinc.com>
2007-05-29 23:40 ` Junio C Hamano
2007-05-30  1:58   ` Shawn O. Pearce
2007-05-30  2:02   ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1180481391179-git-send-email-jbowes@dangerouslyinc.com \
    --to=jbowes@dangerouslyinc.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.