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

[PATCH/RFC 3/6] tag: copy parsed buffer unconditionnaly

From
Marc-André Lureau <marcandre.lureau@gmail.com>
Date
Feb 22, 2009, 18:06 UTC
Message-ID
<e29894ca0902221006v647322c2p5d0c78519ed28473@mail.gmail.com>
Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
---
 tag.c |    3 +++
 tag.h |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tag.c b/tag.c
index eecc636..b53056c 100644
--- a/tag.c
+++ b/tag.c
@@ -82,6 +82,9 @@ int parse_tag_buffer(struct tag *item, void *data,
unsigned long size)
 	if (date)
 		item->date = strtoul(++date, NULL, 10);

+	item->buffer = xmemdupz(data, size);
+	item->size = size;
+
 	if (!strcmp(type, blob_type)) {
 		item->tagged = &lookup_blob(sha1)->object;
 	} else if (!strcmp(type, tree_type)) {
diff --git a/tag.h b/tag.h
index e6edfcf..d7a6846 100644
--- a/tag.h
+++ b/tag.h
@@ -11,6 +11,8 @@ struct tag {
 	char *tag;
 	char *signature;
 	unsigned long date;
+	char *buffer;
+	unsigned long size;
 };

 extern struct tag *lookup_tag(const unsigned char *sha1);
-- 
1.6.2.rc1.28.g05ef4.dirty
Message 1 of 1 in “tag: copy parsed buffer unconditionnaly”
  1. 3/6 tag: copy parsed buffer unconditionnalyMarc-André Lureau, Feb 22, 2009

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.