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

Function s_update_ref

builtin/fetch.c:641–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639}
640
641static int s_update_ref(const char *action,
642 struct ref *ref,
643 struct ref_transaction *transaction,
644 int check_old)
645{
646 char *msg;
647 char *rla = getenv("GIT_REFLOG_ACTION");
648 struct strbuf err = STRBUF_INIT;
649 int ret;
650
651 if (dry_run)
652 return 0;
653 if (!rla)
654 rla = default_rla.buf;
655 msg = xstrfmt("%s: %s", rla, action);
656
657 ret = ref_transaction_update(transaction, ref->name, &ref->new_oid,
658 check_old ? &ref->old_oid : NULL,
659 NULL, NULL, 0, msg, &err);
660
661 if (ret)
662 error("%s", err.buf);
663 strbuf_release(&err);
664 free(msg);
665 return ret;
666}
667
668static int refcol_width(const struct ref *ref_map, int compact_format)
669{

Callers 1

update_local_refFunction · 0.85

Calls 4

xstrfmtFunction · 0.85
ref_transaction_updateFunction · 0.85
errorFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected