File tree 1 file changed +23
-0
lines changed 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,29 @@ void test_submodule_lookup__lookup_even_with_missing_index(void)
151
151
test_submodule_lookup__simple_lookup (); /* baseline should still pass */
152
152
}
153
153
154
+ void test_submodule_lookup__backslashes (void )
155
+ {
156
+ git_config * cfg ;
157
+ git_submodule * sm ;
158
+ git_repository * subrepo ;
159
+ git_buf buf = GIT_BUF_INIT ;
160
+ const char * backslashed_path = "..\\submod2_target" ;
161
+
162
+ cl_git_pass (git_config_open_ondisk (& cfg , "submod2/.gitmodules" ));
163
+ cl_git_pass (git_config_set_string (cfg , "submodule.sm_unchanged.url" , backslashed_path ));
164
+ git_config_free (cfg );
165
+
166
+ cl_git_pass (git_submodule_lookup (& sm , g_repo , "sm_unchanged" ));
167
+ cl_assert_equal_s (backslashed_path , git_submodule_url (sm ));
168
+ cl_git_pass (git_submodule_open (& subrepo , sm ));
169
+
170
+ cl_git_pass (git_submodule_resolve_url (& buf , g_repo , backslashed_path ));
171
+
172
+ git_buf_free (& buf );
173
+ git_submodule_free (sm );
174
+ git_repository_free (subrepo );
175
+ }
176
+
154
177
static void baseline_tests (void )
155
178
{
156
179
/* small baseline that should work even if we change the index or make
You can’t perform that action at this time.
0 commit comments