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

Function ref_transaction_create

refs.c:1491–1507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1489}
1490
1491int ref_transaction_create(struct ref_transaction *transaction,
1492 const char *refname,
1493 const struct object_id *new_oid,
1494 const char *new_target,
1495 unsigned int flags, const char *msg,
1496 struct strbuf *err)
1497{
1498 if (new_oid && new_target)
1499 BUG("create called with both new_oid and new_target set");
1500 if ((!new_oid || is_null_oid(new_oid)) && !new_target) {
1501 strbuf_addf(err, "'%s' has neither a valid OID nor a target", refname);
1502 return 1;
1503 }
1504 return ref_transaction_update(transaction, refname, new_oid,
1505 null_oid(transaction->ref_store->repo->hash_algo), new_target, NULL, flags,
1506 msg, err);
1507}
1508
1509int ref_transaction_delete(struct ref_transaction *transaction,
1510 const char *refname,

Callers 5

migrate_one_refFunction · 0.85
parse_cmd_createFunction · 0.85
parse_cmd_symref_createFunction · 0.85
write_remote_refsFunction · 0.85

Calls 4

is_null_oidFunction · 0.85
strbuf_addfFunction · 0.85
ref_transaction_updateFunction · 0.85
null_oidFunction · 0.85

Tested by

no test coverage detected