Skip to content

Commit ca7d934

Browse files
jltoblergitster
authored andcommitted
bulk-checkin: drop flush_odb_transaction()
Object database transactions can be explicitly flushed via flush_odb_transaction() without actually completing the transaction. This makes the provided transactional interface a bit awkward. Now that there are no longer any flush_odb_transaction() call sites, drop the function to simplify the interface and further ensure that a transaction is only finalized when end_odb_transaction() is invoked. Signed-off-by: Justin Tobler <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9c61d9a commit ca7d934

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

bulk-checkin.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -376,15 +376,6 @@ struct odb_transaction *begin_odb_transaction(struct object_database *odb)
376376
return odb->transaction;
377377
}
378378

379-
void flush_odb_transaction(struct odb_transaction *transaction)
380-
{
381-
if (!transaction)
382-
return;
383-
384-
flush_batch_fsync(transaction);
385-
flush_bulk_checkin_packfile(transaction);
386-
}
387-
388379
void end_odb_transaction(struct odb_transaction *transaction)
389380
{
390381
if (!transaction)
@@ -395,7 +386,8 @@ void end_odb_transaction(struct odb_transaction *transaction)
395386
*/
396387
ASSERT(transaction == transaction->odb->transaction);
397388

398-
flush_odb_transaction(transaction);
389+
flush_batch_fsync(transaction);
390+
flush_bulk_checkin_packfile(transaction);
399391
transaction->odb->transaction = NULL;
400392
free(transaction);
401393
}

bulk-checkin.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ int index_blob_bulk_checkin(struct odb_transaction *transaction,
4343
*/
4444
struct odb_transaction *begin_odb_transaction(struct object_database *odb);
4545

46-
/*
47-
* Make any objects that are currently part of a pending object
48-
* database transaction visible. It is valid to call this function
49-
* even if no transaction is active.
50-
*/
51-
void flush_odb_transaction(struct odb_transaction *transaction);
52-
5346
/*
5447
* Tell the object database to make any objects from the
5548
* current transaction visible.

0 commit comments

Comments
 (0)