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

Function add_remote_info_ref

http-push.c:1469–1506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1467}
1468
1469static void add_remote_info_ref(struct remote_ls_ctx *ls)
1470{
1471 struct strbuf *buf = (struct strbuf *)ls->userData;
1472 struct object *o;
1473 struct ref *ref;
1474
1475 ref = alloc_ref(ls->dentry_name);
1476
1477 if (http_fetch_ref(repo->url, ref) != 0) {
1478 fprintf(stderr,
1479 "Unable to fetch ref %s from %s\n",
1480 ls->dentry_name, repo->url);
1481 aborted = 1;
1482 free(ref);
1483 return;
1484 }
1485
1486 o = parse_object(the_repository, &ref->old_oid);
1487 if (!o) {
1488 fprintf(stderr,
1489 "Unable to parse object %s for remote ref %s\n",
1490 oid_to_hex(&ref->old_oid), ls->dentry_name);
1491 aborted = 1;
1492 free(ref);
1493 return;
1494 }
1495
1496 strbuf_addf(buf, "%s\t%s\n",
1497 oid_to_hex(&ref->old_oid), ls->dentry_name);
1498
1499 if (o->type == OBJ_TAG) {
1500 o = deref_tag(the_repository, o, ls->dentry_name, 0);
1501 if (o)
1502 strbuf_addf(buf, "%s\t%s^{}\n",
1503 oid_to_hex(&o->oid), ls->dentry_name);
1504 }
1505 free(ref);
1506}
1507
1508static void update_remote_info_refs(struct remote_lock *lock)
1509{

Callers

nothing calls this directly

Calls 6

alloc_refFunction · 0.85
http_fetch_refFunction · 0.85
parse_objectFunction · 0.85
oid_to_hexFunction · 0.85
strbuf_addfFunction · 0.85
deref_tagFunction · 0.85

Tested by

no test coverage detected