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:
committed by
Junio C Hamano
parent
4eb0346fb8
commit
996277c520
@ -862,10 +862,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
|
||||
*/
|
||||
discard_cache();
|
||||
read_cache_from(index_file);
|
||||
if (!active_cache_tree)
|
||||
active_cache_tree = cache_tree();
|
||||
if (cache_tree_update(active_cache_tree,
|
||||
active_cache, active_nr, 0, 0) < 0) {
|
||||
if (update_main_cache_tree(0)) {
|
||||
error(_("Error building trees"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user