Skip to content
  • Duy Nguyen's avatar
    cache-tree: fix writing cache-tree when CE_REMOVE is present · 3cf773e4
    Duy Nguyen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    entry_count is used in update_one() for two purposes:
    
    1. to skip through the number of processed entries in in-memory index
    2. to record the number of entries this cache-tree covers on disk
    
    Unfortunately when CE_REMOVE is present these numbers are not the same
    because CE_REMOVE entries are automatically removed before writing to
    disk but entry_count is not adjusted and still counts CE_REMOVE
    entries.
    
    Separate the two use cases into two different variables. #1 is taken
    care by the new field count in struct cache_tree_sub and entry_count
    is prepared for #2.
    
    Signed-off-by: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    3cf773e4