MCPcopy Create free account
hub / github.com/git/git / parse_cmd_symref_create

Function parse_cmd_symref_create

builtin/update-ref.c:435–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435static void parse_cmd_symref_create(struct ref_transaction *transaction,
436 const char *next, const char *end UNUSED,
437 struct command_options *opts)
438{
439 struct strbuf err = STRBUF_INIT;
440 char *refname, *new_target;
441 enum ref_transaction_error tx_err;
442
443 refname = parse_refname(&next);
444 if (!refname)
445 die("symref-create: missing <ref>");
446
447 new_target = parse_next_refname(&next);
448 if (!new_target)
449 die("symref-create %s: missing <new-target>", refname);
450
451 if (*next != line_termination)
452 die("symref-create %s: extra input: %s", refname, next);
453
454 tx_err = ref_transaction_create(transaction, refname, NULL, new_target,
455 update_flags | create_reflog_flag,
456 msg, &err);
457 handle_ref_transaction_error(refname, NULL, NULL, new_target, NULL,
458 tx_err, &err, opts);
459
460 update_flags = default_flags;
461 free(refname);
462 free(new_target);
463 strbuf_release(&err);
464}
465
466static void parse_cmd_delete(struct ref_transaction *transaction,
467 const char *next, const char *end,

Callers

nothing calls this directly

Calls 6

parse_refnameFunction · 0.85
parse_next_refnameFunction · 0.85
ref_transaction_createFunction · 0.85
strbuf_releaseFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected