diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-03-26 09:42:30 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-27 10:23:40 -0700 |
commit | bbbb7de7ac69e66c9263bd0e220172fe717b3f54 (patch) | |
tree | 80bf04c465a9c57847c1bda53ffde33ea5bcacd6 /submodule.h | |
parent | 077be78d7ff0d44cab311da315b2f8dbd2a0d57b (diff) | |
download | git-bbbb7de7ac69e66c9263bd0e220172fe717b3f54.tar.gz |
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.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 |