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

Function refs_delete_ref

refs.c:1008–1029  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006}
1007
1008int refs_delete_ref(struct ref_store *refs, const char *msg,
1009 const char *refname,
1010 const struct object_id *old_oid,
1011 unsigned int flags)
1012{
1013 struct ref_transaction *transaction;
1014 struct strbuf err = STRBUF_INIT;
1015
1016 transaction = ref_store_transaction_begin(refs, 0, &err);
1017 if (!transaction ||
1018 ref_transaction_delete(transaction, refname, old_oid,
1019 NULL, flags, msg, &err) ||
1020 ref_transaction_commit(transaction, &err)) {
1021 error("%s", err.buf);
1022 ref_transaction_free(transaction);
1023 strbuf_release(&err);
1024 return 1;
1025 }
1026 ref_transaction_free(transaction);
1027 strbuf_release(&err);
1028 return 0;
1029}
1030
1031static void copy_reflog_msg(struct strbuf *sb, const char *msg)
1032{

Callers 15

update_one_tracking_refFunction · 0.85
update_refsFunction · 0.85
sequencer_remove_stateFunction · 0.85
print_adviceFunction · 0.85
do_commitFunction · 0.85
do_pick_commitFunction · 0.85
do_mergeFunction · 0.85
apply_save_autostash_refFunction · 0.85
pick_commitsFunction · 0.85
commit_staged_changesFunction · 0.85

Calls 6

ref_transaction_deleteFunction · 0.85
ref_transaction_commitFunction · 0.85
errorFunction · 0.85
ref_transaction_freeFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by 1

cmd_delete_refFunction · 0.68