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

Function verify_commit

builtin/verify-commit.c:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static int verify_commit(struct repository *repo, const char *name, unsigned flags)
37{
38 struct object_id oid;
39 struct object *obj;
40
41 if (repo_get_oid(repo, name, &oid))
42 return error("commit '%s' not found.", name);
43
44 obj = parse_object(repo, &oid);
45 if (!obj)
46 return error("%s: unable to read file.", name);
47 if (obj->type != OBJ_COMMIT)
48 return error("%s: cannot verify a non-commit object of type %s.",
49 name, type_name(obj->type));
50
51 return run_gpg_verify((struct commit *)obj, flags);
52}
53
54int cmd_verify_commit(int argc,
55 const char **argv,

Callers 1

cmd_verify_commitFunction · 0.85

Calls 5

repo_get_oidFunction · 0.85
errorFunction · 0.85
parse_objectFunction · 0.85
type_nameFunction · 0.85
run_gpg_verifyFunction · 0.70

Tested by

no test coverage detected