Skip to content

Commit 20dd124

Browse files
neerajsi-msftdscho
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cffda32 commit 20dd124

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cache-tree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "tree.h"
44
#include "tree-walk.h"
55
#include "cache-tree.h"
6+
#include "bulk-checkin.h"
67
#include "object-store.h"
78
#include "replace-object.h"
89
#include "promisor-remote.h"
@@ -474,8 +475,10 @@ int cache_tree_update(struct index_state *istate, int flags)
474475

475476
trace_performance_enter();
476477
trace2_region_enter("cache_tree", "update", the_repository);
478+
begin_odb_transaction();
477479
i = update_one(istate->cache_tree, istate->cache, istate->cache_nr,
478480
"", 0, &skip, flags);
481+
end_odb_transaction();
479482
trace2_region_leave("cache_tree", "update", the_repository);
480483
trace_performance_leave("cache_tree_update");
481484
if (i < 0)

0 commit comments

Comments
 (0)