{"thread":{"id":"9524","subject":"[PATCH] Avoid ambiguous error message if pack.idx header is wrong","startedAt":"2007-08-14T19:42:37Z","lastAt":"2007-08-14T19:42:37Z","messageCount":1,"participants":["Luiz Fernando N. Capitulino"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"50721","messageId":"20070814164237.20aa54c9@localhost","threadId":"9524","inReplyTo":null,"subject":"[PATCH] Avoid ambiguous error message if pack.idx header is wrong","fromName":"Luiz Fernando N. Capitulino","fromEmail":"lcapitulino@mandriva.com.br","sentAt":"2007-08-14T19:42:37Z","receivedAt":"2007-08-14T19:42:37Z","isPatch":true,"sender":{"key":"lcapitulino@mandriva.com.br","avatar":null},"body":"\nPrint the index version when an error occurs so the user\nknows what type of header (and size) we thought the index\nshould have had.\n\nSigned-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>\n---\n sha1_file.c |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/sha1_file.c b/sha1_file.c\nindex aca741b..b219d4d 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -497,7 +497,7 @@ static int check_packed_git_idx(const char *path,  struct packed_git *p)\n \t\t */\n \t\tif (idx_size != 4*256 + nr * 24 + 20 + 20) {\n \t\t\tmunmap(idx_map, idx_size);\n-\t\t\treturn error(\"wrong index file size in %s\", path);\n+\t\t\treturn error(\"wrong index v1 file size in %s\", path);\n \t\t}\n \t} else if (version == 2) {\n \t\t/*\n@@ -519,7 +519,7 @@ static int check_packed_git_idx(const char *path,  struct packed_git *p)\n \t\t\tmax_size += (nr - 1)*8;\n \t\tif (idx_size < min_size || idx_size > max_size) {\n \t\t\tmunmap(idx_map, idx_size);\n-\t\t\treturn error(\"wrong index file size in %s\", path);\n+\t\t\treturn error(\"wrong index v2 file size in %s\", path);\n \t\t}\n \t\tif (idx_size != min_size) {\n \t\t\t/* make sure we can deal with large pack offsets */\n-- \n1.5.3.GIT\n\n\n\n-- \nLuiz Fernando N. Capitulino\n"}]}