Revert "fetch-pack: add a deref_without_lazy_fetch_extended()"
This reverts commit a6e65fb39caf18259c660c1c7910d5bf80bc15cb. This revert simplifies the next patch in this patch set. The commit message of that commit mentions that the new function "will be used for the bundle-uri client in a subsequent commit", but it seems that eventually it wasn't used. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan committed
Nov 5, 2024 at 11:24 UTC
bf1feb9e53274a21c2f910924d50fb5967c0593e
1 file changed
+7
-18
fetch-pack.c
+7
-18
@@ -122,12 +122,11 @@ static void for_each_cached_alternate(struct fetch_negotiator *negotiator,
122
cb(negotiator, cache.items[i]);
123
}
124
125
-static struct commit *deref_without_lazy_fetch_extended(const struct object_id *oid,
126
- int mark_tags_complete,
127
- enum object_type *type,
128
- unsigned int oi_flags)
125
+static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
126
+ int mark_tags_complete)
127
{
130
- struct object_info info = { .typep = type };
128
+ enum object_type type;
129
+ struct object_info info = { .typep = &type };
130
struct commit *commit;
131
132
commit = lookup_commit_in_graph(the_repository, oid);
@@ -136,9 +135,9 @@ static struct commit *deref_without_lazy_fetch_extended(const struct object_id *
135
136
while (1) {
137
if (oid_object_info_extended(the_repository, oid, &info,
139
- oi_flags))
138
+ OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK))
139
return NULL;
141
- if (*type == OBJ_TAG) {
140
+ if (type == OBJ_TAG) {
141
struct tag *tag = (struct tag *)
142
parse_object(the_repository, oid);
143
@@ -152,7 +151,7 @@ static struct commit *deref_without_lazy_fetch_extended(const struct object_id *
151
}
152
}
153
155
- if (*type == OBJ_COMMIT) {
154
+ if (type == OBJ_COMMIT) {
155
struct commit *commit = lookup_commit(the_repository, oid);
156
if (!commit || repo_parse_commit(the_repository, commit))
157
return NULL;
@@ -162,16 +161,6 @@ static struct commit *deref_without_lazy_fetch_extended(const struct object_id *
161
return NULL;
162
}
163
165
-
166
-static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
167
- int mark_tags_complete)
168
-{
169
- enum object_type type;
170
- unsigned flags = OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK;
171
- return deref_without_lazy_fetch_extended(oid, mark_tags_complete,
172
- &type, flags);
173
-}
174
-
164
static int rev_list_insert_ref(struct fetch_negotiator *negotiator,
165
const struct object_id *oid)
166
{