From bbbb7de7ac69e66c9263bd0e220172fe717b3f54 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Sun, 26 Mar 2017 09:42:30 +0700 Subject: path.c: move some code out of strbuf_git_path_submodule() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs is learning to avoid path rewriting that is done by strbuf_git_path_submodule(). Factor out this code so it could be reused by refs_* functions. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- submodule.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'submodule.h') diff --git a/submodule.h b/submodule.h index c8a0c9cb29..fce2fb64d2 100644 --- a/submodule.h +++ b/submodule.h @@ -81,6 +81,12 @@ extern int push_unpushed_submodules(struct sha1_array *commits, int dry_run); extern void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir); extern int parallel_submodules(void); +/* + * Given a submodule path (as in the index), return the repository + * path of that submodule in 'buf'. Return -1 on error or when the + * submodule is not initialized. + */ +int submodule_to_gitdir(struct strbuf *buf, const char *submodule); /* * Prepare the "env_array" parameter of a "struct child_process" for executing -- cgit v1.3