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

Function gitmodule_oid_from_commit

submodule-config.c:670–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668}
669
670static int gitmodule_oid_from_commit(const struct object_id *treeish_name,
671 struct object_id *gitmodules_oid,
672 struct strbuf *rev)
673{
674 int ret = 0;
675
676 if (is_null_oid(treeish_name)) {
677 oidclr(gitmodules_oid, the_repository->hash_algo);
678 return 1;
679 }
680
681 strbuf_addf(rev, "%s:.gitmodules", oid_to_hex(treeish_name));
682 if (repo_get_oid(the_repository, rev->buf, gitmodules_oid) >= 0)
683 ret = 1;
684
685 return ret;
686}
687
688/* This does a lookup of a submodule configuration by name or by path
689 * (key) with on-demand reading of the appropriate .gitmodules from

Callers 2

config_fromFunction · 0.85
gitmodules_config_oidFunction · 0.85

Calls 5

is_null_oidFunction · 0.85
oidclrFunction · 0.85
strbuf_addfFunction · 0.85
oid_to_hexFunction · 0.85
repo_get_oidFunction · 0.85

Tested by

no test coverage detected