blob: 8281b9cb159691530eb2f74b46daf535261f6c93 [file] [log] [blame]
Junio C Hamano568508e2011-10-28 14:48:40 -07001/*
2 * Copyright (c) 2011, Google Inc.
3 */
4#ifndef BULK_CHECKIN_H
5#define BULK_CHECKIN_H
6
Elijah Newrenef3ca952018-08-15 10:54:05 -07007#include "cache.h"
8
Neeraj Singhc0f47522022-04-04 22:20:09 -07009void prepare_loose_object_bulk_checkin(void);
10void fsync_loose_object_bulk_checkin(int fd, const char *filename);
11
Denton Liu55454422019-04-29 04:28:14 -040012int index_bulk_checkin(struct object_id *oid,
Denton Liuad6dad02019-04-29 04:28:23 -040013 int fd, size_t size, enum object_type type,
14 const char *path, unsigned flags);
Junio C Hamano568508e2011-10-28 14:48:40 -070015
Neeraj Singh2c23d1b2022-04-04 22:20:08 -070016/*
17 * Tell the object database to optimize for adding
18 * multiple objects. end_odb_transaction must be called
19 * to make new objects visible. Transactions can be nested,
20 * and objects are only visible after the outermost transaction
21 * is complete or the transaction is flushed.
22 */
23void begin_odb_transaction(void);
24
25/*
26 * Make any objects that are currently part of a pending object
27 * database transaction visible. It is valid to call this function
28 * even if no transaction is active.
29 */
30void flush_odb_transaction(void);
31
32/*
33 * Tell the object database to make any objects from the
34 * current transaction visible if this is the final nested
35 * transaction.
36 */
37void end_odb_transaction(void);
Junio C Hamano568508e2011-10-28 14:48:40 -070038
39#endif