@@ -2392,11 +2392,6 @@ int git_configset_add_file(struct config_set *cs, const char *filename)
23922392 return git_config_from_file (config_set_callback , filename , cs );
23932393}
23942394
2395- int git_configset_add_parameters (struct config_set * cs )
2396- {
2397- return git_config_from_parameters (config_set_callback , cs );
2398- }
2399-
24002395int git_configset_get_value (struct config_set * cs , const char * key , const char * * value )
24012396{
24022397 const struct string_list * values = NULL ;
@@ -2641,24 +2636,15 @@ int repo_config_get_pathname(struct repository *repo,
26412636/* Read values into protected_config. */
26422637static void read_protected_config (void )
26432638{
2644- char * xdg_config = NULL , * user_config = NULL , * system_config = NULL ;
2645-
2639+ struct config_options opts = {
2640+ .respect_includes = 1 ,
2641+ .ignore_repo = 1 ,
2642+ .ignore_worktree = 1 ,
2643+ .system_gently = 1 ,
2644+ };
26462645 git_configset_init (& protected_config );
2647-
2648- system_config = git_system_config ();
2649- git_global_config (& user_config , & xdg_config );
2650-
2651- if (system_config )
2652- git_configset_add_file (& protected_config , system_config );
2653- if (xdg_config )
2654- git_configset_add_file (& protected_config , xdg_config );
2655- if (user_config )
2656- git_configset_add_file (& protected_config , user_config );
2657- git_configset_add_parameters (& protected_config );
2658-
2659- free (system_config );
2660- free (xdg_config );
2661- free (user_config );
2646+ config_with_options (config_set_callback , & protected_config ,
2647+ NULL , & opts );
26622648}
26632649
26642650void git_protected_config (config_fn_t fn , void * data )
0 commit comments