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

[PATCH] Avoid ambiguous error message if pack.idx header is wrong

From
LCLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Date
Aug 14, 2007, 19:42 UTC
Message-ID
<20070814164237.20aa54c9@localhost>

Print the index version when an error occurs so the user knows what type of header (and size) we thought the index should have had.

Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
---
 sha1_file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index aca741b..b219d4d 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -497,7 +497,7 @@ static int check_packed_git_idx(const char *path,  struct packed_git *p)
 		 */
 		if (idx_size != 4*256 + nr * 24 + 20 + 20) {
 			munmap(idx_map, idx_size);
-			return error("wrong index file size in %s", path);
+			return error("wrong index v1 file size in %s", path);
 		}
 	} else if (version == 2) {
 		/*
@@ -519,7 +519,7 @@ static int check_packed_git_idx(const char *path,  struct packed_git *p)
 			max_size += (nr - 1)*8;
 		if (idx_size < min_size || idx_size > max_size) {
 			munmap(idx_map, idx_size);
-			return error("wrong index file size in %s", path);
+			return error("wrong index v2 file size in %s", path);
 		}
 		if (idx_size != min_size) {
 			/* make sure we can deal with large pack offsets */
-- 
1.5.3.GIT



-- 
Luiz Fernando N. Capitulino
Message 1 of 1 in “Avoid ambiguous error message if pack.idx header is wrong”
  1. Avoid ambiguous error message if pack.idx header is wrongLuiz Fernando N. Capitulino, Aug 14, 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.