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

Function write_remote_refs

builtin/clone.c:473–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473static void write_remote_refs(const struct ref *local_refs)
474{
475 const struct ref *r;
476
477 struct ref_transaction *t;
478 struct strbuf err = STRBUF_INIT;
479
480 t = ref_store_transaction_begin(get_main_ref_store(the_repository),
481 REF_TRANSACTION_FLAG_INITIAL, &err);
482 if (!t)
483 die("%s", err.buf);
484
485 for (r = local_refs; r; r = r->next) {
486 if (!r->peer_ref)
487 continue;
488 if (ref_transaction_create(t, r->peer_ref->name, &r->old_oid,
489 NULL, 0, NULL, &err))
490 die("%s", err.buf);
491 }
492
493 if (ref_transaction_commit(t, &err))
494 die("%s", err.buf);
495
496 strbuf_release(&err);
497 ref_transaction_free(t);
498}
499
500static void write_followtags(const struct ref *refs, const char *msg)
501{

Callers 1

update_remote_refsFunction · 0.85

Calls 7

get_main_ref_storeFunction · 0.85
ref_transaction_createFunction · 0.85
ref_transaction_commitFunction · 0.85
strbuf_releaseFunction · 0.85
ref_transaction_freeFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected