summaryrefslogtreecommitdiff
path: root/submodule.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2017-03-26 02:42:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-27 17:23:40 (GMT)
commitbbbb7de7ac69e66c9263bd0e220172fe717b3f54 (patch)
tree80bf04c465a9c57847c1bda53ffde33ea5bcacd6 /submodule.h
parent077be78d7ff0d44cab311da315b2f8dbd2a0d57b (diff)
downloadgit-bbbb7de7ac69e66c9263bd0e220172fe717b3f54.zip
git-bbbb7de7ac69e66c9263bd0e220172fe717b3f54.tar.gz
git-bbbb7de7ac69e66c9263bd0e220172fe717b3f54.tar.bz2
path.c: move some code out of strbuf_git_path_submodule()
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
-rw-r--r--submodule.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/submodule.h b/submodule.h
index c8a0c9c..fce2fb6 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