Skip to content
  • Duy Nguyen's avatar
    read-cache.c: remove 'const' from index_has_changes() · 92a1bf5a
    Duy Nguyen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    This function calls do_diff_cache() which eventually needs to set this
    "istate" to unpack_options->src_index [1]. This is an unfortunate fact
    that unpack_trees() _will_ update [2] src_index so we can't really pass a
    const index_state there. Just remove 'const'.
    
    [1] Right now diff_cache() in diff-lib.c assigns the_index to
        src_index. But the plan is to get rid of the_index, so it should
        be 'istate' from here that gets assigned to src_index.
    
    [2] Some transient bits in the source index are touched. Optional
        extensions can also be removed. But other than that the source
        tree should still be valid.
    
    Signed-off-by: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    92a1bf5a