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

[PATCH 1/9] Display the null SHA-1 as the base for an OBJ_OFS_DELTA.

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 7, 2007, 01:44 UTC
Message-ID
<20070307014408.GB26482@spearce.org>

Because we are currently cheating and never supplying the delta base for an OBJ_OFS_DELTA we get a random SHA-1 in the delta base field. Instead lets clear the hash out so its at least all 0's. This is somewhat more obvious that something fishy is going on, like we don't actually have the SHA-1 of the base handy. :)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 sha1_file.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index 6d0a72e..c13ef66 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1200,6 +1200,7 @@ const char *packed_object_info_detail(struct packed_git *p,
 			obj_offset = get_delta_base(p, &w_curs, &curpos, type, obj_offset);
 			if (*delta_chain_length == 0) {
 				/* TODO: find base_sha1 as pointed by curpos */
+				hashclr(base_sha1);
 			}
 			break;
 		case OBJ_REF_DELTA:
-- 
1.5.0.3.863.gf0989
Message 1 of 1 in “Display the null SHA-1 as the base for an OBJ_OFS_DELTA.”
  1. 1/9 Display the null SHA-1 as the base for an OBJ_OFS_DELTA.Shawn O. Pearce, Mar 7, 2007

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.