diff options
| author | Vicent Marti <vicent@github.com> | 2014-09-03 12:19:48 +0200 |
|---|---|---|
| committer | Vicent Marti <vicent@github.com> | 2014-09-03 12:19:48 +0200 |
| commit | 4c958046d3ed7f67c6dee495b8d874df9048dc55 (patch) | |
| tree | a0c182e25758c43c77acf92eae31ea99b65f2a55 /include/git2 | |
| parent | eb939c57725e7c3951153ff1ff67b35f4b22bbf3 (diff) | |
| parent | bc737620dd0d331cb80c22d074569fe29b7ab585 (diff) | |
| download | libgit2-4c958046d3ed7f67c6dee495b8d874df9048dc55.tar.gz | |
Merge pull request #2530 from libgit2/jamill/relative_gitlink
Teach repository to use relative paths for git symbolic links
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/repository.h | 3 | ||||
| -rw-r--r-- | include/git2/submodule.h | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index 18e515cb0..268782648 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -196,6 +196,8 @@ GIT_EXTERN(int) git_repository_init( * looking the "template_path" from the options if set, or the * `init.templatedir` global config if not, or falling back on * "/usr/share/git-core/templates" if it exists. + * * GIT_REPOSITORY_INIT_RELATIVE_GITLINK - If an alternate workdir is + * specified, use relative paths for the gitdir and core.worktree. */ typedef enum { GIT_REPOSITORY_INIT_BARE = (1u << 0), @@ -204,6 +206,7 @@ typedef enum { GIT_REPOSITORY_INIT_MKDIR = (1u << 3), GIT_REPOSITORY_INIT_MKPATH = (1u << 4), GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE = (1u << 5), + GIT_REPOSITORY_INIT_RELATIVE_GITLINK = (1u << 6), } git_repository_init_flag_t; /** 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 |
