diff options
author | Jameson Miller <jamill@microsoft.com> | 2014-08-20 10:24:41 -0400 |
---|---|---|
committer | Jameson Miller <jamill@microsoft.com> | 2014-09-02 21:07:26 -0400 |
commit | bc737620dd0d331cb80c22d074569fe29b7ab585 (patch) | |
tree | 02845048ed92a316433bf6c38d8283408d6b530f /include/git2/submodule.h | |
parent | 0ee9f31c3b11116ab5806ab80d03b1d37197d6ce (diff) | |
download | libgit2-jamill/relative_gitlink.tar.gz |
Introduce option to use relative paths for repository work directoryjamill/relative_gitlink
Teach git_repository_init_ext to use relative paths for the gitlink
to the work directory. This is used when creating a sub repository
where the sub repository resides in the parent repository's
.git directory.
Diffstat (limited to 'include/git2/submodule.h')
-rw-r--r-- | include/git2/submodule.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/git2/submodule.h b/include/git2/submodule.h index 864d1c58c..616890df6 100644 --- a/include/git2/submodule.h +++ b/include/git2/submodule.h @@ -471,6 +471,24 @@ GIT_EXTERN(git_submodule_recurse_t) git_submodule_set_fetch_recurse_submodules( GIT_EXTERN(int) git_submodule_init(git_submodule *submodule, int overwrite); /** + * Set up the subrepository for a submodule in preparation for clone. + * + * This function can be called to init and set up a submodule + * repository from a submodule in preparation to clone it from + * its remote. + * + * @param out Output pointer to the created git repository. + * @param sm The submodule to create a new subrepository from. + * @param use_gitlink Should the workdir contain a gitlink to + * the repo in .git/modules vs. repo directly in workdir. + * @return 0 on success, <0 on failure. + */ +GIT_EXTERN(int) git_submodule_repo_init( + git_repository **out, + const git_submodule *sm, + int use_gitlink); + +/** * Copy submodule remote info into submodule repo. * * This copies the information about the submodules URL into the checked out |