Commit f576b7dd by Carlos Martín Nieto

midx: allow unknown chunk ids in multi-pack index files

These chunks work like extensions where it's fine not to know what one means. We
can skip over it and keep processing the file instead of erroring out.
parent f041a94e
......@@ -185,7 +185,8 @@ int git_midx_parse(
chunk_oid_fanout = {0},
chunk_oid_lookup = {0},
chunk_object_offsets = {0},
chunk_object_large_offsets = {0};
chunk_object_large_offsets = {0},
chunk_unknown = {0};
GIT_ASSERT_ARG(idx);
......@@ -264,7 +265,9 @@ int git_midx_parse(
break;
default:
return midx_error("unrecognized chunk ID");
chunk_unknown.offset = last_chunk_offset;
last_chunk = &chunk_unknown;
break;
}
}
last_chunk->length = (size_t)(trailer_offset - last_chunk_offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment