| 668 | } |
| 669 | |
| 670 | static 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 |
no test coverage detected