summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 16:14:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 21:14:43 (GMT)
commit383480ba4ffc15b975e324bf7abbc01324d9935e (patch)
tree70e61f2d0c1e024ccc05da2e1d09eccf514f6f5e /unpack-trees.c
parent340f4bc9f8686c813410ef954ee00b8c66c78e91 (diff)
downloadgit-383480ba4ffc15b975e324bf7abbc01324d9935e.zip
git-383480ba4ffc15b975e324bf7abbc01324d9935e.tar.gz
git-383480ba4ffc15b975e324bf7abbc01324d9935e.tar.bz2
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>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index f9efee08..c07a6cd 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1552,6 +1552,17 @@ static int verify_uptodate_sparse(const struct cache_entry *ce,
return verify_uptodate_1(ce, o, ERROR_SPARSE_NOT_UPTODATE_FILE);
}
+/*
+ * TODO: We should actually invalidate o->result, not src_index [1].
+ * But since cache tree and untracked cache both are not copied to
+ * o->result until unpacking is complete, we invalidate them on
+ * src_index instead with the assumption that they will be copied to
+ * dst_index at the end.
+ *
+ * [1] src_index->cache_tree is also used in unpack_callback() so if
+ * we invalidate o->result, we need to update it to use
+ * o->result.cache_tree as well.
+ */
static void invalidate_ce_path(const struct cache_entry *ce,
struct unpack_trees_options *o)
{