summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <dstolee@microsoft.com>2021-01-23 19:58:12 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-01-23 17:14:07 -0800
commit8d87e338e16e022545638a0e9a3e15c6bdb56111 (patch)
tree3d02c87ba1f6d1f5f39965588f573cc3cc1ddc87 /Documentation
parentcache-tree: clean up cache_tree_update() (diff)
downloadtgif-8d87e338e16e022545638a0e9a3e15c6bdb56111.tar.xz
cache-tree: simplify verify_cache() prototype
The verify_cache() method takes an array of cache entries and a count, but these are always provided directly from a struct index_state. Use a pointer to the full structure instead. There is a subtle point when istate->cache_nr is zero that subtracting one will underflow. This triggers a failure in t0000-basic.sh, among others. Use "i + 1 < istate->cache_nr" to avoid these strange comparisons. Convert i to be unsigned as well, which also removes the potential signed overflow in the unlikely case that cache_nr is over 2.1 billion entries. The 'funny' variable has a maximum value of 11, so making it unsigned does not change anything of importance. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions