All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Martin Langhoff <martin.langhoff@gmail.com>
Cc: Martin Langhoff <martin@catalyst.net.nz>, git@vger.kernel.org
Subject: Re: [PATCH] cg-fetch will now retrieve commits related to tags if missing.
Date: Wed, 19 Oct 2005 22:23:30 -0700	[thread overview]
Message-ID: <7v3bmwu5gt.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 46a038f90510192159h25aad025kf377e3e33b5d30d@mail.gmail.com

Martin Langhoff <martin.langhoff@gmail.com> writes:

> Ok -- I was using ^{commit} which _is_ lazy, but you are
> right, ^0 isn't lazy.

Ah, my mistake.  We would need something like this.

---

diff --git a/sha1_name.c b/sha1_name.c
index 75c688e..cc320d3 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -323,6 +323,8 @@ static int peel_onion(const char *name, 
 		return -1;
 	if (!type_string) {
 		o = deref_tag(o);
+		if (!o || (!o->parsed && !parse_object(o->sha1)))
+			return -1;
 		memcpy(sha1, o->sha1, 20);
 	}
 	else {
@@ -332,7 +334,7 @@ static int peel_onion(const char *name, 
 		 */
 
 		while (1) {
-			if (!o)
+			if (!o || (!o->parsed && !parse_object(o->sha1)))
 				return -1;
 			if (o->type == type_string) {
 				memcpy(sha1, o->sha1, 20);

      reply	other threads:[~2005-10-20  5:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-20  0:55 [PATCH] cg-fetch will now retrieve commits related to tags if missing Martin Langhoff
2005-10-20  1:25 ` Junio C Hamano
2005-10-20  4:15   ` Martin Langhoff
2005-10-20  4:18   ` Martin Langhoff
2005-10-20  4:44     ` Junio C Hamano
2005-10-20  4:59       ` Martin Langhoff
2005-10-20  5:23         ` Junio C Hamano [this message]

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=7v3bmwu5gt.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=martin.langhoff@gmail.com \
    --cc=martin@catalyst.net.nz \
    /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.