unpack-trees: add a note about path invalidation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Aug 13, 2018 at 18:14 UTC 383480ba4ffc15b975e324bf7abbc01324d9935e
1 file changed +11
unpack-trees.c
+11
@@ -1552,6 +1552,17 @@ static int verify_uptodate_sparse(const struct cache_entry *ce,
1552 return verify_uptodate_1(ce, o, ERROR_SPARSE_NOT_UPTODATE_FILE);
1553 }
1554
1555 +/*
1556 + * TODO: We should actually invalidate o->result, not src_index [1].
1557 + * But since cache tree and untracked cache both are not copied to
1558 + * o->result until unpacking is complete, we invalidate them on
1559 + * src_index instead with the assumption that they will be copied to
1560 + * dst_index at the end.
1561 + *
1562 + * [1] src_index->cache_tree is also used in unpack_callback() so if
1563 + * we invalidate o->result, we need to update it to use
1564 + * o->result.cache_tree as well.
1565 + */
1566 static void invalidate_ce_path(const struct cache_entry *ce,
1567 struct unpack_trees_options *o)
1568 {