Skip to content

Commit e3c8462

Browse files
committed
config_file: rename parse_data struct
The struct `parse_data` sounds as if it was defined and passed to us from the configuration parser, which is not true. Instead, `parse_data` is specific to the diskfile backend parsing logic. Rename it to `diskfile_parse_state` to make that clearer. This also follows existing naming patterns with the "diskfile" prefix.
1 parent 18117a6 commit e3c8462

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/config_file.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ typedef struct {
6969
diskfile_backend *snapshot_from;
7070
} diskfile_readonly_backend;
7171

72+
typedef struct {
73+
const git_repository *repo;
74+
const char *file_path;
75+
git_strmap *values;
76+
git_config_level_t level;
77+
unsigned int depth;
78+
} diskfile_parse_state;
79+
7280
static int config_read(git_strmap *values, const git_repository *repo, git_config_file *file, git_config_level_t level, int depth);
7381
static int config_write(diskfile_backend *cfg, const char *orig_key, const char *key, const regex_t *preg, const char *value);
7482
static char *escape_value(const char *ptr);
@@ -869,16 +877,8 @@ static char *escape_value(const char *ptr)
869877
return git_buf_detach(&buf);
870878
}
871879

872-
struct parse_data {
873-
const git_repository *repo;
874-
const char *file_path;
875-
git_strmap *values;
876-
git_config_level_t level;
877-
unsigned int depth;
878-
};
879-
880880
static int parse_include(git_config_parser *reader,
881-
struct parse_data *parse_data, const char *file)
881+
diskfile_parse_state *parse_data, const char *file)
882882
{
883883
struct config_file *include;
884884
git_buf path = GIT_BUF_INIT;
@@ -980,7 +980,7 @@ static const struct {
980980
};
981981

982982
static int parse_conditional_include(git_config_parser *reader,
983-
struct parse_data *parse_data, const char *section, const char *file)
983+
diskfile_parse_state *parse_data, const char *section, const char *file)
984984
{
985985
char *condition;
986986
size_t i;
@@ -1021,7 +1021,7 @@ static int read_on_variable(
10211021
size_t line_len,
10221022
void *data)
10231023
{
1024-
struct parse_data *parse_data = (struct parse_data *)data;
1024+
diskfile_parse_state *parse_data = (diskfile_parse_state *)data;
10251025
git_buf buf = GIT_BUF_INIT;
10261026
git_config_entry *entry;
10271027
int result = 0;
@@ -1069,7 +1069,7 @@ static int config_read(
10691069
git_config_level_t level,
10701070
int depth)
10711071
{
1072-
struct parse_data parse_data;
1072+
diskfile_parse_state parse_data;
10731073
git_config_parser reader;
10741074
git_buf contents = GIT_BUF_INIT;
10751075
int error;

0 commit comments

Comments
 (0)