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

Function do_submodule_path

path.c:560–585  ·  view source on GitHub ↗

Returns 0 on success, negative on failure. */

Source from the content-addressed store, hash-verified

558
559/* Returns 0 on success, negative on failure. */
560static int do_submodule_path(struct repository *repo,
561 struct strbuf *buf, const char *path,
562 const char *fmt, va_list args)
563{
564 struct strbuf git_submodule_common_dir = STRBUF_INIT;
565 struct strbuf git_submodule_dir = STRBUF_INIT;
566 int ret;
567
568 ret = submodule_to_gitdir(repo, &git_submodule_dir, path);
569 if (ret)
570 goto cleanup;
571
572 strbuf_complete(&git_submodule_dir, '/');
573 strbuf_addbuf(buf, &git_submodule_dir);
574 strbuf_vaddf(buf, fmt, args);
575
576 if (get_common_dir_noenv(&git_submodule_common_dir, git_submodule_dir.buf))
577 update_common_dir(buf, git_submodule_dir.len, git_submodule_common_dir.buf);
578
579 strbuf_cleanup_path(buf);
580
581cleanup:
582 strbuf_release(&git_submodule_dir);
583 strbuf_release(&git_submodule_common_dir);
584 return ret;
585}
586
587char *repo_submodule_path(struct repository *repo,
588 const char *path, const char *fmt, ...)

Callers 3

repo_submodule_pathFunction · 0.85

Calls 8

submodule_to_gitdirFunction · 0.85
strbuf_completeFunction · 0.85
strbuf_addbufFunction · 0.85
strbuf_vaddfFunction · 0.85
get_common_dir_noenvFunction · 0.85
update_common_dirFunction · 0.85
strbuf_cleanup_pathFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected