Git fork

object-file: drop `index_blob_stream()`

The `index_blob_stream()` function is a mere wrapper around
`index_blob_bulk_checkin()`. This has been the case since 568508e7657
(bulk-checkin: replace fast-import based implementation, 2011-10-28),
which has moved the implementation from `index_blob_stream()` (which was
still called `index_stream()`) into `index_bulk_checkin()` (which has
since been renamed to `index_blob_bulk_checkin()`).

Remove the redirection by dropping the wrapper. Move the comment to
`index_blob_bulk_checkin()` to retain its context.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
8a54ebd5 70c0f9db

+17 -24
+15
bulk-checkin.h
··· 9 9 void prepare_loose_object_bulk_checkin(void); 10 10 void fsync_loose_object_bulk_checkin(int fd, const char *filename); 11 11 12 + /* 13 + * This creates one packfile per large blob unless bulk-checkin 14 + * machinery is "plugged". 15 + * 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. 26 + */ 12 27 int index_blob_bulk_checkin(struct object_id *oid, 13 28 int fd, size_t size, 14 29 const char *path, unsigned flags);
+2 -24
object-file.c
··· 1356 1356 return ret; 1357 1357 } 1358 1358 1359 - /* 1360 - * This creates one packfile per large blob unless bulk-checkin 1361 - * machinery is "plugged". 1362 - * 1363 - * This also bypasses the usual "convert-to-git" dance, and that is on 1364 - * purpose. We could write a streaming version of the converting 1365 - * functions and insert that before feeding the data to fast-import 1366 - * (or equivalent in-core API described above). However, that is 1367 - * somewhat complicated, as we do not know the size of the filter 1368 - * result, which we need to know beforehand when writing a git object. 1369 - * Since the primary motivation for trying to stream from the working 1370 - * tree file and to avoid mmaping it in core is to deal with large 1371 - * binary blobs, they generally do not want to get any conversion, and 1372 - * callers should avoid this code path when filters are requested. 1373 - */ 1374 - static int index_blob_stream(struct object_id *oid, int fd, size_t size, 1375 - const char *path, 1376 - unsigned flags) 1377 - { 1378 - return index_blob_bulk_checkin(oid, fd, size, path, flags); 1379 - } 1380 - 1381 1359 int index_fd(struct index_state *istate, struct object_id *oid, 1382 1360 int fd, struct stat *st, 1383 1361 enum object_type type, const char *path, unsigned flags) ··· 1398 1376 ret = index_core(istate, oid, fd, xsize_t(st->st_size), 1399 1377 type, path, flags); 1400 1378 else 1401 - ret = index_blob_stream(oid, fd, xsize_t(st->st_size), path, 1402 - flags); 1379 + ret = index_blob_bulk_checkin(oid, fd, xsize_t(st->st_size), path, 1380 + flags); 1403 1381 close(fd); 1404 1382 return ret; 1405 1383 }