summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorNeeraj Singh <neerajsi@microsoft.com>2022-04-05 05:20:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-04-06 20:13:26 (GMT)
commit4d33e2ba6b9db6a28085b2ef7e46d30a981875ab (patch)
tree0a28e2fcbab9b9b1492f39a54dfca0f803d25fef /cache-tree.c
parentc0f4752ed2ffb89d10a9e469a83f089cc7e9df9d (diff)
downloadgit-4d33e2ba6b9db6a28085b2ef7e46d30a981875ab.zip
git-4d33e2ba6b9db6a28085b2ef7e46d30a981875ab.tar.gz
git-4d33e2ba6b9db6a28085b2ef7e46d30a981875ab.tar.bz2
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 <neerajsi@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 65ca993..3441c49 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -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)
trace_performance_enter();
trace2_region_enter("cache_tree", "update", the_repository);
+ begin_odb_transaction();
i = update_one(istate->cache_tree, istate->cache, istate->cache_nr,
"", 0, &skip, flags);
+ end_odb_transaction();
trace2_region_leave("cache_tree", "update", the_repository);
trace_performance_leave("cache_tree_update");
if (i < 0)