summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-15 13:50:14 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-15 13:50:15 -0700
commitee847e0034dbfde11f901fbfb74d210c1edad496 (patch)
tree3baa54bf940d7f0506b9160127fcc2b88ad4764b /upload-pack.c
parentf3f00d93a10ac3f000c56e73d646e34fe7b456d1 (diff)
parent7d70b29c4f0b2fd3c6698956d9fb4026632d9c6e (diff)
Merge branch 'ps/object-wo-the-repository'
The object layer has been updated to take an explicit repository instance as a parameter in more code paths. * ps/object-wo-the-repository: hash: stop depending on `the_repository` in `null_oid()` hash: fix "-Wsign-compare" warnings object-file: split out logic regarding hash algorithms delta-islands: stop depending on `the_repository` object-file-convert: stop depending on `the_repository` pack-bitmap-write: stop depending on `the_repository` pack-revindex: stop depending on `the_repository` pack-check: stop depending on `the_repository` environment: move access to "core.bigFileThreshold" into repo settings pack-write: stop depending on `the_repository` and `the_hash_algo` object: stop depending on `the_repository` csum-file: stop depending on `the_repository`
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 7498b45e2e..02ce633602 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -665,8 +665,8 @@ static int do_reachable_revlist(struct child_process *cmd,
cmd_in = xfdopen(cmd->in, "w");
- for (i = get_max_object_index(); 0 < i; ) {
- o = get_indexed_object(--i);
+ for (i = get_max_object_index(the_repository); 0 < i; ) {
+ o = get_indexed_object(the_repository, --i);
if (!o)
continue;
if (reachable && o->type == OBJ_COMMIT)
@@ -734,8 +734,8 @@ static int get_reachable_list(struct upload_pack_data *data,
o->flags &= ~TMP_MARK;
}
}
- for (i = get_max_object_index(); 0 < i; i--) {
- o = get_indexed_object(i - 1);
+ for (i = get_max_object_index(the_repository); 0 < i; i--) {
+ o = get_indexed_object(the_repository, i - 1);
if (o && o->type == OBJ_COMMIT &&
(o->flags & TMP_MARK)) {
add_object_array(o, NULL, reachable);
@@ -1449,7 +1449,7 @@ void upload_pack(const int advertise_refs, const int stateless_rpc,
for_each_namespaced_ref_1(send_ref, &data);
if (!data.sent_capabilities) {
const char *refname = "capabilities^{}";
- write_v0_ref(&data, refname, refname, null_oid());
+ write_v0_ref(&data, refname, refname, null_oid(the_hash_algo));
}
/*
* fflush stdout before calling advertise_shallow_grafts because send_ref
@@ -1557,7 +1557,7 @@ static int parse_want_ref(struct packet_writer *writer, const char *line,
}
if (!o)
- o = parse_object_or_die(&oid, refname_nons);
+ o = parse_object_or_die(the_repository, &oid, refname_nons);
if (!(o->flags & WANTED)) {
o->flags |= WANTED;
@@ -1793,7 +1793,7 @@ int upload_pack_v2(struct repository *r, struct packet_reader *request)
enum fetch_state state = FETCH_PROCESS_ARGS;
struct upload_pack_data data;
- clear_object_flags(ALL_FLAGS);
+ clear_object_flags(the_repository, ALL_FLAGS);
upload_pack_data_init(&data);
data.use_sideband = LARGE_PACKET_MAX;