void test_repo_reservedname__includes_shortname_on_win32(void)
{
git_repository *repo;
- git_buf *reserved;
+ git_str *reserved;
size_t reserved_len;
repo = cl_git_sandbox_init("nasty");
void test_repo_reservedname__includes_shortname_when_requested(void)
{
git_repository *repo;
- git_buf *reserved;
+ git_str *reserved;
size_t reserved_len;
repo = cl_git_sandbox_init("nasty");
{
#ifdef GIT_WIN32
git_repository *repo;
- git_buf *reserved;
+ git_str *reserved;
size_t reserved_len;
if (!cl_sandbox_supports_8dot3())
#ifdef GIT_WIN32
git_repository *super_repo, *sub_repo;
git_submodule *sub;
- git_buf *sub_reserved;
+ git_str *sub_reserved;
size_t sub_reserved_len;
if (!cl_sandbox_supports_8dot3())
git_repository_free(sub_repo);
#endif
}
+
+/* Like the `submodule_pointer` test (above), this ensures that we do not
+ * follow the gitlink to the submodule's repository location and treat that
+ * as a reserved name. This tests at an initial submodule update, where the
+ * submodule repo is being created.
+ */
+void test_repo_reservedname__submodule_pointer_during_create(void)
+{
+ git_repository *repo;
+ git_submodule *sm;
+ git_submodule_update_options update_options = GIT_SUBMODULE_UPDATE_OPTIONS_INIT;
+ git_str url = GIT_STR_INIT;
+
+ repo = setup_fixture_super();
+
+ cl_git_pass(git_str_joinpath(&url, clar_sandbox_path(), "sub.git"));
+ cl_repo_set_string(repo, "submodule.sub.url", url.ptr);
+
+ cl_git_pass(git_submodule_lookup(&sm, repo, "sub"));
+ cl_git_pass(git_submodule_update(sm, 1, &update_options));
+
+ git_submodule_free(sm);
+ git_str_dispose(&url);
+}