| 1006 | } |
| 1007 | |
| 1008 | int 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 | |
| 1031 | static void copy_reflog_msg(struct strbuf *sb, const char *msg) |
| 1032 | { |