aboutsummaryrefslogtreecommitdiff
path: root/streaming.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-11-23 19:59:38 +0100
committerJunio C Hamano <gitster@pobox.com>2025-11-23 12:56:45 -0800
commitc26da3446e98ad4aa98ec9154c70c6fd35cb9ad6 (patch)
tree0d49eeae98907ce7139f3c47ae8f27e02570cb6d /streaming.c
parent4c89d31494bff4bde6079a0e0821f1437e37d07b (diff)
downloadgit-c26da3446e98ad4aa98ec9154c70c6fd35cb9ad6.tar.xz
streaming: get rid of `the_repository`
Subsequent commits will move the backend-specific logic of object streaming into their respective subsystems. These subsystems have gotten rid of `the_repository` already, but we still use it in two locations in the streaming subsystem. Prepare for the move by fixing those two cases. Converting the logic in `open_istream_pack_non_delta()` is trivial as we already got the object database as input. But for `stream_blob_to_fd()` we have to add a new parameter to make it accessible. So, as we already have to adjust all callers anyway, rename the function to `odb_stream_blob_to_fd()` to indicate it's part of the object subsystem. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'streaming.c')
-rw-r--r--streaming.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/streaming.c b/streaming.c
index f0f7d31956..807a6e03a8 100644
--- a/streaming.c
+++ b/streaming.c
@@ -2,8 +2,6 @@
* Copyright (c) 2011, Google Inc.
*/
-#define USE_THE_REPOSITORY_VARIABLE
-
#include "git-compat-util.h"
#include "convert.h"
#include "environment.h"
@@ -359,7 +357,7 @@ static int open_istream_pack_non_delta(struct odb_read_stream **out,
if (packfile_store_read_object_info(odb->packfiles, oid, &oi, 0) ||
oi.u.packed.is_delta ||
- repo_settings_get_big_file_threshold(the_repository) >= size)
+ repo_settings_get_big_file_threshold(odb->repo) >= size)
return -1;
in_pack_type = unpack_object_header(oi.u.packed.pack,
@@ -518,8 +516,11 @@ struct odb_read_stream *open_istream(struct repository *r,
return st;
}
-int stream_blob_to_fd(int fd, const struct object_id *oid, struct stream_filter *filter,
- int can_seek)
+int odb_stream_blob_to_fd(struct object_database *odb,
+ int fd,
+ const struct object_id *oid,
+ struct stream_filter *filter,
+ int can_seek)
{
struct odb_read_stream *st;
enum object_type type;
@@ -527,7 +528,7 @@ int stream_blob_to_fd(int fd, const struct object_id *oid, struct stream_filter
ssize_t kept = 0;
int result = -1;
- st = open_istream(the_repository, oid, &type, &sz, filter);
+ st = open_istream(odb->repo, oid, &type, &sz, filter);
if (!st) {
if (filter)
free_stream_filter(filter);