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

Function parse_cmd_create

builtin/update-ref.c:402–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402static 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
435static void parse_cmd_symref_create(struct ref_transaction *transaction,
436 const char *next, const char *end UNUSED,

Callers

nothing calls this directly

Calls 7

parse_refnameFunction · 0.85
parse_next_oidFunction · 0.85
is_null_oidFunction · 0.85
ref_transaction_createFunction · 0.85
strbuf_releaseFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected