config: make the config source const

The `struct git_config_source` passed to `config_with_options()` is never modified. Let's mark it as `const` to clarify. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed May 15, 2024 at 08:42 UTC 12b23068307d512de7de8f551102f5928ab8b88a
2 files changed +3 -3
config.c
+2 -2
@@ -125,7 +125,7 @@ struct config_include_data {
125 config_fn_t fn;
126 void *data;
127 const struct config_options *opts;
128 - struct git_config_source *config_source;
128 + const struct git_config_source *config_source;
129 struct repository *repo;
130
131 /*
@@ -2105,7 +2105,7 @@ static int do_git_config_sequence(const struct config_options *opts,
2105 }
2106
2107 int config_with_options(config_fn_t fn, void *data,
2108 - struct git_config_source *config_source,
2108 + const struct git_config_source *config_source,
2109 struct repository *repo,
2110 const struct config_options *opts)
2111 {
config.h
+1 -1
@@ -232,7 +232,7 @@ void git_config(config_fn_t fn, void *);
232 * sets `opts.respect_includes` to `1` by default.
233 */
234 int config_with_options(config_fn_t fn, void *,
235 - struct git_config_source *config_source,
235 + const struct git_config_source *config_source,
236 struct repository *repo,
237 const struct config_options *opts);
238