unpack-trees: convert clear_ce_flags* to avoid the_index
commit27c82fb3b406e01bbcd6c7cb11dc1925b88f6a92
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Mon, 13 Aug 2018 16:14:28 +0000 (13 18:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Aug 2018 21:14:43 +0000 (13 14:14 -0700)
tree9cee10666f65575ca081e51f2dbecbb35c5982b9
parent86016ec3042ec52eef9f45386c50384419d030c0
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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack-trees.c