File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -695,3 +695,27 @@ void test_config_write__locking(void)
695695
696696 git_config_free (cfg );
697697}
698+
699+ void test_config_write__repeated (void )
700+ {
701+ const char * filename = "config-repeated" ;
702+ git_config * cfg ;
703+ git_buf result ;
704+ const char * expected = "[sample \"prefix\"]\n\
705+ \tsetting1 = someValue1\n\
706+ \tsetting2 = someValue2\n\
707+ \tsetting3 = someValue3\n\
708+ \tsetting4 = someValue4\n\
709+ " ;
710+ cl_git_pass (git_config_open_ondisk (& cfg , filename ));
711+ cl_git_pass (git_config_set_string (cfg , "sample.prefix.setting1" , "someValue1" ));
712+ cl_git_pass (git_config_set_string (cfg , "sample.prefix.setting2" , "someValue2" ));
713+ cl_git_pass (git_config_set_string (cfg , "sample.prefix.setting3" , "someValue3" ));
714+ cl_git_pass (git_config_set_string (cfg , "sample.prefix.setting4" , "someValue4" ));
715+
716+ cl_git_pass (git_config_open_ondisk (& cfg , filename ));
717+
718+ cl_git_pass (git_futils_readbuffer (& result , filename ));
719+ cl_assert_equal_s (expected , result .ptr );
720+ git_buf_free (& result );
721+ }
You can’t perform that action at this time.
0 commit comments