The sixteenth batch
[git/gitster.git] / bulk-checkin.h
blob7246ea58dcf3481e026560f987138b1efe112390
1 /*
2 * Copyright (c) 2011, Google Inc.
3 */
4 #ifndef BULK_CHECKIN_H
5 #define BULK_CHECKIN_H
7 #include "object.h"
9 void prepare_loose_object_bulk_checkin(void);
10 void fsync_loose_object_bulk_checkin(int fd, const char *filename);
13 * This creates one packfile per large blob unless bulk-checkin
14 * machinery is "plugged".
16 * This also bypasses the usual "convert-to-git" dance, and that is on
17 * purpose. We could write a streaming version of the converting
18 * functions and insert that before feeding the data to fast-import
19 * (or equivalent in-core API described above). However, that is
20 * somewhat complicated, as we do not know the size of the filter
21 * result, which we need to know beforehand when writing a git object.
22 * Since the primary motivation for trying to stream from the working
23 * tree file and to avoid mmaping it in core is to deal with large
24 * binary blobs, they generally do not want to get any conversion, and
25 * callers should avoid this code path when filters are requested.
27 int index_blob_bulk_checkin(struct object_id *oid,
28 int fd, size_t size,
29 const char *path, unsigned flags);
32 * Tell the object database to optimize for adding
33 * multiple objects. end_odb_transaction must be called
34 * to make new objects visible. Transactions can be nested,
35 * and objects are only visible after the outermost transaction
36 * is complete or the transaction is flushed.
38 void begin_odb_transaction(void);
41 * Make any objects that are currently part of a pending object
42 * database transaction visible. It is valid to call this function
43 * even if no transaction is active.
45 void flush_odb_transaction(void);
48 * Tell the object database to make any objects from the
49 * current transaction visible if this is the final nested
50 * transaction.
52 void end_odb_transaction(void);
54 #endif