| 1489 | } |
| 1490 | |
| 1491 | int 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 | |
| 1509 | int ref_transaction_delete(struct ref_transaction *transaction, |
| 1510 | const char *refname, |
no test coverage detected