cache-tree: use ODB transaction around writing a tree

Take advantage of the odb transaction infrastructure around writing the
cached tree to the object database.

Signed-off-by: Neeraj Singh <>
Signed-off-by: Junio C Hamano <>
This commit is contained in:
Neeraj Singh 2022-04-04 22:20:10 -07:00 committed by Junio C Hamano
parent c0f4752ed2
commit 4d33e2ba6b
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#include "tree.h"
#include "tree-walk.h"
#include "cache-tree.h"
#include "bulk-checkin.h"
#include "object-store.h"
#include "replace-object.h"
#include "promisor-remote.h"
@ -474,8 +475,10 @@ int cache_tree_update(struct index_state *istate, int flags)
trace2_region_enter("cache_tree", "update", the_repository);
i = update_one(istate->cache_tree, istate->cache, istate->cache_nr,
"", 0, &skip, flags);
trace2_region_leave("cache_tree", "update", the_repository);
if (i < 0)