@@ -759,6 +759,36 @@ void test_config_read__bom(void)
759759 git_buf_dispose (& buf );
760760}
761761
762+ void test_config_read__single_line (void )
763+ {
764+ git_buf buf = GIT_BUF_INIT ;
765+ git_config * cfg ;
766+
767+ cl_set_cleanup (& clean_test_config , NULL );
768+ cl_git_mkfile ("./testconfig" , "[some] var = value\n[some \"OtheR\"] var = value" );
769+ cl_git_pass (git_config_open_ondisk (& cfg , "./testconfig" ));
770+ cl_git_pass (git_config_get_string_buf (& buf , cfg , "some.var" ));
771+ cl_assert_equal_s (buf .ptr , "value" );
772+
773+ git_buf_clear (& buf );
774+ cl_git_pass (git_config_get_string_buf (& buf , cfg , "some.OtheR.var" ));
775+ cl_assert_equal_s (buf .ptr , "value" );
776+
777+ git_config_free (cfg );
778+ cl_git_mkfile ("./testconfig" , "[some] var = value\n[some \"OtheR\"]var = value" );
779+ cl_git_pass (git_config_open_ondisk (& cfg , "./testconfig" ));
780+ git_buf_clear (& buf );
781+ cl_git_pass (git_config_get_string_buf (& buf , cfg , "some.var" ));
782+ cl_assert_equal_s (buf .ptr , "value" );
783+
784+ git_buf_clear (& buf );
785+ cl_git_pass (git_config_get_string_buf (& buf , cfg , "some.OtheR.var" ));
786+ cl_assert_equal_s (buf .ptr , "value" );
787+
788+ git_config_free (cfg );
789+ git_buf_dispose (& buf );
790+ }
791+
762792static int read_nosection_cb (const git_config_entry * entry , void * payload ) {
763793 int * seen = (int * )payload ;
764794 if (strcmp (entry -> name , "key" ) == 0 ) {
0 commit comments