From: Nguyễn Thái Ngọc Duy Date: Mon, 13 Aug 2018 16:14:28 +0000 (+0200) Subject: unpack-trees: convert clear_ce_flags* to avoid the_index X-Git-Tag: v2.19.0-rc0~16^2~13 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/27c82fb3b406e01bbcd6c7cb11dc1925b88f6a92?hp=27c82fb3b406e01bbcd6c7cb11dc1925b88f6a92 unpack-trees: convert clear_ce_flags* to avoid the_index Prior to fba92be8f7, this code implicitly (and incorrectly) assumes the_index when running the exclude machinery. fba92be8f7 helps show this problem clearer because unpack-trees operation is supposed to work on whatever index the caller specifies... not specifically the_index. Update the code to use "istate" argument that's originally from mark_new_skip_worktree(). From the call sites, both in unpack_trees(), you can see that this function works on two separate indexes: o->src_index and o->result. The second mark_new_skip_worktree() so far has incorecctly applied exclude rules on o->src_index instead of o->result. It's unclear what is the consequences of this, but it's definitely wrong. [1] fba92be8f7 (dir: convert is_excluded_from_list to take an index - 2017-05-05) Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano ---