Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cache-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ static int update_one(struct repository *repo,

int cache_tree_update(struct index_state *istate, int flags)
{
int inflight = !!istate->repo->objects->transaction;
int start_transaction = !istate->repo->objects->transaction &&
!(flags & WRITE_TREE_REPAIR);
struct odb_transaction *transaction;
int skip, i;

Expand All @@ -542,11 +543,11 @@ int cache_tree_update(struct index_state *istate, int flags)

trace_performance_enter();
trace2_region_enter("cache_tree", "update", istate->repo);
if (!inflight)
if (start_transaction)
odb_transaction_begin_or_die(istate->repo->objects, &transaction, 0);
i = update_one(istate->repo, istate->cache_tree, istate->cache, istate->cache_nr,
"", 0, &skip, flags);
if (!inflight)
if (start_transaction)
odb_transaction_commit_and_finalize_or_die(transaction);
trace2_region_leave("cache_tree", "update", istate->repo);
trace_performance_leave("cache_tree_update");
Expand Down
Loading