135135committer KN4CK3R <[email protected] > 1711702962 +0100 136136encoding ISO-8859-1 
137137gpgsig -----BEGIN PGP SIGNATURE----- 
138-   
138+ <SPACE> 
139139 iQGzBAABCgAdFiEE9HRrbqvYxPT8PXbefPSEkrowAa8FAmYGg7IACgkQfPSEkrow 
140140 Aa9olwv+P0HhtCM6CRvlUmPaqswRsDPNR4i66xyXGiSxdI9V5oJL7HLiQIM7KrFR 
141141 gizKa2COiGtugv8fE+TKqXKaJx6uJUJEjaBd8E9Af9PrAzjWj+A84lU6/PgPS8hq 
@@ -150,7 +150,7 @@ gpgsig -----BEGIN PGP SIGNATURE-----
150150 -----END PGP SIGNATURE----- 
151151
152152ISO-8859-1` 
153- 
153+ 	 commitString   =   strings . ReplaceAll ( commitString ,  "<SPACE>" ,  " " ) 
154154	sha  :=  & Sha1Hash {0xfe , 0xaf , 0x4b , 0xa6 , 0xbc , 0x63 , 0x5f , 0xec , 0x44 , 0x2f , 0x46 , 0xdd , 0xd4 , 0x51 , 0x24 , 0x16 , 0xec , 0x43 , 0xc2 , 0xc2 }
155155	gitRepo , err  :=  openRepositoryWithDefaultContext (filepath .Join (testReposDir , "repo1_bare" ))
156156	assert .NoError (t , err )
@@ -362,3 +362,41 @@ func Test_GetCommitBranchStart(t *testing.T) {
362362	assert .NotEmpty (t , startCommitID )
363363	assert .EqualValues (t , "9c9aef8dd84e02bc7ec12641deb4c930a7c30185" , startCommitID )
364364}
365+ 
366+ func  TestConfigSubModule (t  * testing.T ) {
367+ 	input  :=  ` 
368+ [core] 
369+ path = test 
370+ 
371+ [submodule "submodule1"] 
372+ 	path = path1 
373+ 	url =	https://gitea.io/foo/foo 
374+ 	#branch = b1 
375+ 
376+ [other1] 
377+ branch = master 
378+ 
379+ [submodule "submodule2"] 
380+ 	path = path2 
381+ 	url =	https://gitea.io/bar/bar 
382+ 	branch = b2 
383+ 
384+ [other2] 
385+ branch = main 
386+ 
387+ [submodule "submodule3"] 
388+ 	path = path3 
389+ 	url =	https://gitea.io/xxx/xxx 
390+ ` 
391+ 
392+ 	subModules , err  :=  configParseSubModules (strings .NewReader (input ))
393+ 	assert .NoError (t , err )
394+ 	assert .Len (t , subModules .cache , 3 )
395+ 
396+ 	sm1 , _  :=  subModules .Get ("path1" )
397+ 	assert .Equal (t , & SubModule {Name : "path1" , URL : "https://gitea.io/foo/foo" }, sm1 )
398+ 	sm2 , _  :=  subModules .Get ("path2" )
399+ 	assert .Equal (t , & SubModule {Name : "path2" , URL : "https://gitea.io/bar/bar" }, sm2 )
400+ 	sm3 , _  :=  subModules .Get ("path3" )
401+ 	assert .Equal (t , & SubModule {Name : "path3" , URL : "https://gitea.io/xxx/xxx" }, sm3 )
402+ }
0 commit comments