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

2018-08-28 Thread Stefan Beller
> "r" it is! I forgot about it. But this is for local variable or > argument names only right? The field name (in diff_options for > example) should stay something more descriptive like repo, I think. Yea I agree, we should have more descriptive things in long lived structs. Thanks, Stefan

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

2018-08-28 Thread Duy Nguyen
On Mon, Aug 27, 2018 at 8:37 PM Stefan Beller wrote: > > On Sun, Aug 26, 2018 at 3:03 AM Nguyễn Thái Ngọc Duy > wrote: > > > > This function calls do_diff_cache() which eventually needs to set this > > "istate" to unpack_options->src_index (*). This is an unfornate fact > > unfortunate > > > dif

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

2018-08-27 Thread Stefan Beller
On Sun, Aug 26, 2018 at 3:03 AM Nguyễn Thái Ngọc Duy wrote: > > This function calls do_diff_cache() which eventually needs to set this > "istate" to unpack_options->src_index (*). This is an unfornate fact unfortunate > diff --git a/diff.c b/diff.c Unlike I thought in the cover letter, this is

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

2018-08-26 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 unfornate 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 diff-lib.c