MCPcopy Index your code
hub / github.com/git/git / get_delta

Function get_delta

http-push.c:1342–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1340}
1341
1342static int get_delta(struct rev_info *revs, struct remote_lock *lock)
1343{
1344 struct commit *commit;
1345 struct object_list **p = &objects;
1346 int count = 0;
1347
1348 while ((commit = get_revision(revs)) != NULL) {
1349 p = process_tree(repo_get_commit_tree(the_repository, commit),
1350 p);
1351 commit->object.flags |= LOCAL;
1352 if (!(commit->object.flags & UNINTERESTING))
1353 count += add_send_request(&commit->object, lock);
1354 }
1355
1356 for (size_t i = 0; i < revs->pending.nr; i++) {
1357 struct object_array_entry *entry = revs->pending.objects + i;
1358 struct object *obj = entry->item;
1359 const char *name = entry->name;
1360
1361 if (obj->flags & (UNINTERESTING | SEEN))
1362 continue;
1363 if (obj->type == OBJ_TAG) {
1364 obj->flags |= SEEN;
1365 p = add_one_object(obj, p);
1366 continue;
1367 }
1368 if (obj->type == OBJ_TREE) {
1369 p = process_tree((struct tree *)obj, p);
1370 continue;
1371 }
1372 if (obj->type == OBJ_BLOB) {
1373 p = process_blob((struct blob *)obj, p);
1374 continue;
1375 }
1376 die("unknown pending object %s (%s)", oid_to_hex(&obj->oid), name);
1377 }
1378
1379 while (objects) {
1380 struct object_list *next = objects->next;
1381
1382 if (!(objects->item->flags & UNINTERESTING))
1383 count += add_send_request(objects->item, lock);
1384
1385 free(objects);
1386 objects = next;
1387 }
1388
1389 return count;
1390}
1391
1392static int update_remote(const struct object_id *oid, struct remote_lock *lock)
1393{

Callers 1

cmd_mainFunction · 0.70

Calls 8

get_revisionFunction · 0.85
repo_get_commit_treeFunction · 0.85
add_send_requestFunction · 0.85
oid_to_hexFunction · 0.85
process_treeFunction · 0.70
add_one_objectFunction · 0.70
process_blobFunction · 0.70
dieFunction · 0.70

Tested by

no test coverage detected