]> git.ipfire.org Git - thirdparty/git.git/commit - cache-tree.c
cache-tree: invalidate i-t-a paths after generating trees
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 16 Dec 2012 04:15:28 +0000 (11:15 +0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 16 Dec 2012 07:04:22 +0000 (23:04 -0800)
commiteec3e7e406867487036cf447fe8fa18740824b2f
tree1fab13da5e36b82b19f5da59b9339157c5847bcd
parent3cf773e4264ecc6e9f603a24aeb72cc68b372f96
cache-tree: invalidate i-t-a paths after generating trees

Intent-to-add entries used to forbid writing trees so it was not a
problem. After commit 3f6d56d (commit: ignore intent-to-add entries
instead of refusing - 2012-02-07), we can generate trees from an index
with i-t-a entries.

However, the commit forgets to invalidate all paths leading to i-t-a
entries. With fully valid cache-tree (e.g. after commit or
write-tree), diff operations may prefer cache-tree to index and not
see i-t-a entries in the index, because cache-tree does not have them.

Reported-by: Jonathon Mah <me@JonathonMah.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c
t/t2203-add-intent.sh