diff options
author | Edward Thomson <ethomson@microsoft.com> | 2015-09-17 17:49:32 -0400 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-09-18 12:17:49 -0400 |
commit | e8ddd8d76c119903677b5d0c638c875023ae6784 (patch) | |
tree | 224ba11504a626ede5968ea13b976ebe6b408d9b /tests/submodule | |
parent | add0378d8eb76cb7fde92bcbed3eb59ee5b8947c (diff) | |
download | libgit2-e8ddd8d76c119903677b5d0c638c875023ae6784.tar.gz |
repo::reservedname: test a submodule update
Test an initial submodule update, where we are trying to checkout
the submodule for the first time, and placing a file within the
submodule working directory with the same name as the submodule
(and consequently, the same name as the repository itself).
Diffstat (limited to 'tests/submodule')
-rw-r--r-- | tests/submodule/submodule_helpers.c | 16 | ||||
-rw-r--r-- | tests/submodule/submodule_helpers.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tests/submodule/submodule_helpers.c b/tests/submodule/submodule_helpers.c index 1dc687231..cde69d92d 100644 --- a/tests/submodule/submodule_helpers.c +++ b/tests/submodule/submodule_helpers.c @@ -126,6 +126,22 @@ git_repository *setup_fixture_submod2(void) return repo; } +git_repository *setup_fixture_super(void) +{ + git_repository *repo = cl_git_sandbox_init("super"); + + cl_fixture_sandbox("sub.git"); + p_mkdir("super/sub", 0777); + + rewrite_gitmodules(git_repository_workdir(repo)); + + cl_set_cleanup(cleanup_fixture_submodules, "sub.git"); + + cl_git_pass(git_repository_reinit_filesystem(repo, 1)); + + return repo; +} + git_repository *setup_fixture_submodule_simple(void) { git_repository *repo = cl_git_sandbox_init("submodule_simple"); diff --git a/tests/submodule/submodule_helpers.h b/tests/submodule/submodule_helpers.h index 1493f245f..1191ab35b 100644 --- a/tests/submodule/submodule_helpers.h +++ b/tests/submodule/submodule_helpers.h @@ -4,6 +4,7 @@ extern void rewrite_gitmodules(const char *workdir); extern git_repository *setup_fixture_submodules(void); extern git_repository *setup_fixture_submod2(void); extern git_repository *setup_fixture_submodule_simple(void); +extern git_repository *setup_fixture_super(void); extern unsigned int get_submodule_status(git_repository *, const char *); |