Refactor cache_tree_update idiom from commit

We'll need to safely create or update the cache-tree data of the_index
from other places.  While at it, give it an argument that lets us
silence the messages produced by unmerged entries (which prevent it
from working).

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Thomas Rast
2011-12-06 18:43:37 +01:00
committed by Junio C Hamano
parent 4eb0346fb8
commit 996277c520
5 changed files with 21 additions and 11 deletions

View File

@ -59,6 +59,6 @@ int main(int ac, char **av)
struct cache_tree *another = cache_tree();
if (read_cache() < 0)
die("unable to read index file");
cache_tree_update(another, active_cache, active_nr, 0, 1);
cache_tree_update(another, active_cache, active_nr, 0, 1, 0);
return dump_cache_tree(active_cache_tree, another, "");
}