mirror of
				https://git.proxmox.com/git/libgit2
				synced 2025-10-31 15:00:12 +00:00 
			
		
		
		
	submodule: add failing test for backslash in url
This commit is contained in:
		
							parent
							
								
									38dc994031
								
							
						
					
					
						commit
						a89a756d87
					
				| @ -151,6 +151,29 @@ void test_submodule_lookup__lookup_even_with_missing_index(void) | ||||
| 	test_submodule_lookup__simple_lookup(); /* baseline should still pass */ | ||||
| } | ||||
| 
 | ||||
| void test_submodule_lookup__backslashes(void) | ||||
| { | ||||
| 	git_config *cfg; | ||||
| 	git_submodule *sm; | ||||
| 	git_repository *subrepo; | ||||
| 	git_buf buf = GIT_BUF_INIT; | ||||
| 	const char *backslashed_path = "..\\submod2_target"; | ||||
| 
 | ||||
| 	cl_git_pass(git_config_open_ondisk(&cfg, "submod2/.gitmodules")); | ||||
| 	cl_git_pass(git_config_set_string(cfg, "submodule.sm_unchanged.url", backslashed_path)); | ||||
| 	git_config_free(cfg); | ||||
| 
 | ||||
| 	cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_unchanged")); | ||||
| 	cl_assert_equal_s(backslashed_path, git_submodule_url(sm)); | ||||
| 	cl_git_pass(git_submodule_open(&subrepo, sm)); | ||||
| 
 | ||||
| 	cl_git_pass(git_submodule_resolve_url(&buf, g_repo, backslashed_path)); | ||||
| 
 | ||||
| 	git_buf_free(&buf); | ||||
| 	git_submodule_free(sm); | ||||
| 	git_repository_free(subrepo); | ||||
| } | ||||
| 
 | ||||
| static void baseline_tests(void) | ||||
| { | ||||
| 	/* small baseline that should work even if we change the index or make
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Carlos Martín Nieto
						Carlos Martín Nieto