MCPcopy Create free account
hub / github.com/git/git / load_index_extensions

Function load_index_extensions

read-cache.c:1999–2024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1997};
1998
1999static void *load_index_extensions(void *_data)
2000{
2001 struct load_index_extensions *p = _data;
2002 unsigned long src_offset = p->src_offset;
2003
2004 while (src_offset <= p->mmap_size - the_hash_algo->rawsz - 8) {
2005 /* After an array of active_nr index entries,
2006 * there can be arbitrary number of extended
2007 * sections, each of which is prefixed with
2008 * extension name (4-byte) and section length
2009 * in 4-byte network byte order.
2010 */
2011 uint32_t extsize = get_be32(p->mmap + src_offset + 4);
2012 if (read_index_extension(p->istate,
2013 p->mmap + src_offset,
2014 p->mmap + src_offset + 8,
2015 extsize) < 0) {
2016 munmap((void *)p->mmap, p->mmap_size);
2017 die(_("index file corrupt"));
2018 }
2019 src_offset += 8;
2020 src_offset += extsize;
2021 }
2022
2023 return NULL;
2024}
2025
2026/*
2027 * A helper function that will load the specified range of cache entries

Callers 1

do_read_indexFunction · 0.70

Calls 3

get_be32Function · 0.85
read_index_extensionFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected