Re: [PATCH v4 02/23] read-cache.c: remove 'const' from index_has_changes()

2018-09-17 Thread Junio C Hamano
Duy Nguyen writes: > On Mon, Sep 17, 2018 at 6:25 PM Junio C Hamano wrote: >> >> Nguyễn Thái Ngọc Duy writes: >> >> > This function calls do_diff_cache() which eventually needs to set this >> > "istate" to unpack_options->src_index (*). This is an unfortunate fact >> > that unpack_trees()

Re: [PATCH v4 02/23] read-cache.c: remove 'const' from index_has_changes()

2018-09-17 Thread Duy Nguyen
On Mon, Sep 17, 2018 at 6:25 PM Junio C Hamano wrote: > > Nguyễn Thái Ngọc Duy writes: > > > This function calls do_diff_cache() which eventually needs to set this > > "istate" to unpack_options->src_index (*). This is an unfortunate fact > > that unpack_trees() _will_ destroy src_index so we

Re: [PATCH v4 02/23] read-cache.c: remove 'const' from index_has_changes()

2018-09-17 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > This function calls do_diff_cache() which eventually needs to set this > "istate" to unpack_options->src_index (*). This is an unfortunate fact > that unpack_trees() _will_ destroy src_index so we can't really pass a Wasn't the whole point of introducing

[PATCH v4 02/23] read-cache.c: remove 'const' from index_has_changes()

2018-09-15 Thread Nguyễn Thái Ngọc Duy
This function calls do_diff_cache() which eventually needs to set this "istate" to unpack_options->src_index (*). This is an unfortunate fact that unpack_trees() _will_ destroy src_index so we can't really pass a const index_state there. Just remove 'const'. (*) Right now diff_cache() in