MCPcopy Create free account
hub / github.com/git/git / deref_without_lazy_fetch

Function deref_without_lazy_fetch

fetch-pack.c:137–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137static struct commit *deref_without_lazy_fetch(const struct object_id *oid,
138 int mark_tags_complete_and_check_obj_db)
139{
140 enum object_type type;
141 struct object_info info = { .typep = &type };
142 struct commit *commit;
143
144 commit = lookup_commit_in_graph(the_repository, oid);
145 if (commit) {
146 if (mark_tags_complete_and_check_obj_db) {
147 if (!odb_has_object(the_repository->objects, oid,
148 ODB_HAS_OBJECT_RECHECK_PACKED))
149 die_in_commit_graph_only(oid);
150 }
151 return commit;
152 }
153
154 while (1) {
155 if (odb_read_object_info_extended(the_repository->objects, oid, &info,
156 OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK))
157 return NULL;
158 if (type == OBJ_TAG) {
159 struct tag *tag = (struct tag *)
160 parse_object(the_repository, oid);
161
162 if (!tag->tagged)
163 return NULL;
164 if (mark_tags_complete_and_check_obj_db)
165 tag->object.flags |= COMPLETE;
166 oid = &tag->tagged->oid;
167 } else {
168 break;
169 }
170 }
171
172 if (type == OBJ_COMMIT) {
173 struct commit *commit = lookup_commit(the_repository, oid);
174 if (!commit || repo_parse_commit(the_repository, commit))
175 return NULL;
176 return commit;
177 }
178
179 return NULL;
180}
181
182static int rev_list_insert_ref(struct fetch_negotiator *negotiator,
183 const struct object_id *oid)

Callers 3

rev_list_insert_refFunction · 0.85
mark_completeFunction · 0.85

Calls 7

lookup_commit_in_graphFunction · 0.85
odb_has_objectFunction · 0.85
die_in_commit_graph_onlyFunction · 0.85
parse_objectFunction · 0.85
lookup_commitFunction · 0.85
repo_parse_commitFunction · 0.85

Tested by

no test coverage detected