git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cg-fetch will now retrieve commits related to tags if missing.

From
Junio C Hamano <junkio@cox.net>
Date
Oct 20, 2005, 05:23 UTC
Message-ID
<7v3bmwu5gt.fsf@assigned-by-dhcp.cox.net>
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);
Previous: Martin Langhoff
Message 7 of 7 in “cg-fetch will now retrieve commits related to tags if missing.”
  1. cg-fetch will now retrieve commits related to tags if missing.Martin Langhoff, Oct 20, 2005
  2. Junio C HamanoOct 20, 2005
  3. Martin LanghoffOct 20, 2005
  4. Martin LanghoffOct 20, 2005
  5. Junio C HamanoOct 20, 2005
  6. Martin LanghoffOct 20, 2005
  7. Junio C HamanoOct 20, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.