summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>2007-08-14 19:42:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-08-15 05:20:13 (GMT)
commiteef427a09ce7fcbdc54c73ae363cbab331eccd88 (patch)
treeb222f393fdaeac70616efd80b7c1571d458fe7da /sha1_file.c
parentb798671fa935492ce511766bc99fb26b2892499b (diff)
downloadgit-eef427a09ce7fcbdc54c73ae363cbab331eccd88.zip
git-eef427a09ce7fcbdc54c73ae363cbab331eccd88.tar.gz
git-eef427a09ce7fcbdc54c73ae363cbab331eccd88.tar.bz2
Avoid ambiguous error message if pack.idx header is wrong
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c4
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 */