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

Function parse_cmd_verify

builtin/update-ref.c:530–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530static void parse_cmd_verify(struct ref_transaction *transaction,
531 const char *next, const char *end,
532 struct command_options *opts UNUSED)
533{
534 struct strbuf err = STRBUF_INIT;
535 char *refname;
536 struct object_id old_oid;
537
538 refname = parse_refname(&next);
539 if (!refname)
540 die("verify: missing <ref>");
541
542 if (parse_next_oid(&next, end, &old_oid, "verify", refname,
543 PARSE_SHA1_OLD))
544 oidclr(&old_oid, the_repository->hash_algo);
545
546 if (*next != line_termination)
547 die("verify %s: extra input: %s", refname, next);
548
549 if (ref_transaction_verify(transaction, refname, &old_oid,
550 NULL, update_flags, &err))
551 die("%s", err.buf);
552
553 update_flags = default_flags;
554 free(refname);
555 strbuf_release(&err);
556}
557
558static void parse_cmd_symref_verify(struct ref_transaction *transaction,
559 const char *next, const char *end UNUSED,

Callers

nothing calls this directly

Calls 6

parse_refnameFunction · 0.85
parse_next_oidFunction · 0.85
oidclrFunction · 0.85
ref_transaction_verifyFunction · 0.85
strbuf_releaseFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected