File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -722,3 +722,26 @@ void test_config_write__repeated(void)
722722
723723 git_config_free (cfg );
724724}
725+
726+ void test_config_write__preserve_case (void )
727+ {
728+ const char * filename = "config-preserve-case" ;
729+ git_config * cfg ;
730+ git_buf result = GIT_BUF_INIT ;
731+ const char * expected = "[sOMe]\n" \
732+ "\tThInG = foo\n" \
733+ "\tOtheR = thing\n" ;
734+
735+ cl_git_pass (git_config_open_ondisk (& cfg , filename ));
736+ cl_git_pass (git_config_set_string (cfg , "sOMe.ThInG" , "foo" ));
737+ cl_git_pass (git_config_set_string (cfg , "SomE.OtheR" , "thing" ));
738+ git_config_free (cfg );
739+
740+ cl_git_pass (git_config_open_ondisk (& cfg , filename ));
741+
742+ cl_git_pass (git_futils_readbuffer (& result , filename ));
743+ cl_assert_equal_s (expected , result .ptr );
744+ git_buf_free (& result );
745+
746+ git_config_free (cfg );
747+ }
You can’t perform that action at this time.
0 commit comments