| 400 | } |
| 401 | |
| 402 | static void parse_cmd_create(struct ref_transaction *transaction, |
| 403 | const char *next, const char *end, |
| 404 | struct command_options *opts) |
| 405 | { |
| 406 | struct strbuf err = STRBUF_INIT; |
| 407 | char *refname; |
| 408 | struct object_id new_oid; |
| 409 | enum ref_transaction_error tx_err; |
| 410 | |
| 411 | refname = parse_refname(&next); |
| 412 | if (!refname) |
| 413 | die("create: missing <ref>"); |
| 414 | |
| 415 | if (parse_next_oid(&next, end, &new_oid, "create", refname, 0)) |
| 416 | die("create %s: missing <new-oid>", refname); |
| 417 | |
| 418 | if (is_null_oid(&new_oid)) |
| 419 | die("create %s: zero <new-oid>", refname); |
| 420 | |
| 421 | if (*next != line_termination) |
| 422 | die("create %s: extra input: %s", refname, next); |
| 423 | |
| 424 | tx_err = ref_transaction_create(transaction, refname, &new_oid, NULL, |
| 425 | update_flags | create_reflog_flag, |
| 426 | msg, &err); |
| 427 | handle_ref_transaction_error(refname, &new_oid, NULL, NULL, NULL, tx_err, |
| 428 | &err, opts); |
| 429 | |
| 430 | update_flags = default_flags; |
| 431 | free(refname); |
| 432 | strbuf_release(&err); |
| 433 | } |
| 434 | |
| 435 | static void parse_cmd_symref_create(struct ref_transaction *transaction, |
| 436 | const char *next, const char *end UNUSED, |
nothing calls this directly
no test coverage detected