diff options
author | René Scharfe <l.s.r@web.de> | 2020-09-19 23:23:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-20 00:56:05 +0200 |
commit | 200589abcb4d7f107ed9da85e43b9a7268016c23 (patch) | |
tree | 1b9e0829b242a6a1439ee9b115700842460737ad /archive.h | |
parent | Fifteenth batch (diff) | |
download | git-200589abcb4d7f107ed9da85e43b9a7268016c23.tar.xz git-200589abcb4d7f107ed9da85e43b9a7268016c23.zip |
archive: read short blobs in archive.c::write_archive_entry()
Centralize reading of symlink destinations and the contents of regular
files that are too small to be streamed. This reduces code duplication
and allows future patches to add support for adding non-tracked files to
archives. The backends are expected to stream blobs if buffer is NULL.
object_file_to_archive() is only called from archive.c and thus no
longer exported.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive.h')
-rw-r--r-- | archive.h | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -49,12 +49,9 @@ void init_archivers(void); typedef int (*write_archive_entry_fn_t)(struct archiver_args *args, const struct object_id *oid, const char *path, size_t pathlen, - unsigned int mode); + unsigned int mode, + void *buffer, unsigned long size); int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry); -void *object_file_to_archive(const struct archiver_args *args, - const char *path, const struct object_id *oid, - unsigned int mode, enum object_type *type, - unsigned long *sizep); #endif /* ARCHIVE_H */ |