Skip to content

Commit b30b04a

Browse files
committed
config_snapshot: rename function names
The configuration snapshot backend has been extracted from the old files backend back in 2bff84b (config_file: separate out read-only backend, 2019-07-26). To keep code churn manageable, the local functions weren't renamed yet and thus still have references to the old diskfile backend. Rename them accordingly to make them easier to understand.
1 parent 82d7a11 commit b30b04a

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/config_snapshot.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static int config_error_readonly(void)
2222
return -1;
2323
}
2424

25-
static int config_iterator_new_readonly(
25+
static int config_snapshot_iterator(
2626
git_config_iterator **iter,
2727
struct git_config_backend *backend)
2828
{
@@ -41,13 +41,13 @@ static int config_iterator_new_readonly(
4141
}
4242

4343
/* release the map containing the entry as an equivalent to freeing it */
44-
static void free_diskfile_entry(git_config_entry *entry)
44+
static void config_snapshot_entry_free(git_config_entry *entry)
4545
{
4646
git_config_entries *entries = (git_config_entries *) entry->payload;
4747
git_config_entries_free(entries);
4848
}
4949

50-
static int config_get_readonly(git_config_backend *cfg, const char *key, git_config_entry **out)
50+
static int config_snapshot_get(git_config_backend *cfg, const char *key, git_config_entry **out)
5151
{
5252
config_snapshot_backend *b = GIT_CONTAINER_OF(cfg, config_snapshot_backend, parent);
5353
git_config_entries *entries = NULL;
@@ -68,14 +68,14 @@ static int config_get_readonly(git_config_backend *cfg, const char *key, git_con
6868
return error;
6969
}
7070

71-
entry->free = free_diskfile_entry;
71+
entry->free = config_snapshot_entry_free;
7272
entry->payload = entries;
7373
*out = entry;
7474

7575
return 0;
7676
}
7777

78-
static int config_set_readonly(git_config_backend *cfg, const char *name, const char *value)
78+
static int config_snapshot_set(git_config_backend *cfg, const char *name, const char *value)
7979
{
8080
GIT_UNUSED(cfg);
8181
GIT_UNUSED(name);
@@ -84,7 +84,7 @@ static int config_set_readonly(git_config_backend *cfg, const char *name, const
8484
return config_error_readonly();
8585
}
8686

87-
static int config_set_multivar_readonly(
87+
static int config_snapshot_set_multivar(
8888
git_config_backend *cfg, const char *name, const char *regexp, const char *value)
8989
{
9090
GIT_UNUSED(cfg);
@@ -95,7 +95,7 @@ static int config_set_multivar_readonly(
9595
return config_error_readonly();
9696
}
9797

98-
static int config_delete_multivar_readonly(git_config_backend *cfg, const char *name, const char *regexp)
98+
static int config_snapshot_delete_multivar(git_config_backend *cfg, const char *name, const char *regexp)
9999
{
100100
GIT_UNUSED(cfg);
101101
GIT_UNUSED(name);
@@ -104,30 +104,30 @@ static int config_delete_multivar_readonly(git_config_backend *cfg, const char *
104104
return config_error_readonly();
105105
}
106106

107-
static int config_delete_readonly(git_config_backend *cfg, const char *name)
107+
static int config_snapshot_delete(git_config_backend *cfg, const char *name)
108108
{
109109
GIT_UNUSED(cfg);
110110
GIT_UNUSED(name);
111111

112112
return config_error_readonly();
113113
}
114114

115-
static int config_lock_readonly(git_config_backend *_cfg)
115+
static int config_snapshot_lock(git_config_backend *_cfg)
116116
{
117117
GIT_UNUSED(_cfg);
118118

119119
return config_error_readonly();
120120
}
121121

122-
static int config_unlock_readonly(git_config_backend *_cfg, int success)
122+
static int config_snapshot_unlock(git_config_backend *_cfg, int success)
123123
{
124124
GIT_UNUSED(_cfg);
125125
GIT_UNUSED(success);
126126

127127
return config_error_readonly();
128128
}
129129

130-
static void backend_readonly_free(git_config_backend *_backend)
130+
static void config_snapshot_free(git_config_backend *_backend)
131131
{
132132
config_snapshot_backend *backend = GIT_CONTAINER_OF(_backend, config_snapshot_backend, parent);
133133

@@ -139,7 +139,7 @@ static void backend_readonly_free(git_config_backend *_backend)
139139
git__free(backend);
140140
}
141141

142-
static int config_readonly_open(git_config_backend *cfg, git_config_level_t level, const git_repository *repo)
142+
static int config_snapshot_open(git_config_backend *cfg, git_config_level_t level, const git_repository *repo)
143143
{
144144
config_snapshot_backend *b = GIT_CONTAINER_OF(cfg, config_snapshot_backend, parent);
145145
git_config_entries *entries = NULL;
@@ -188,17 +188,17 @@ int git_config_backend_snapshot(git_config_backend **out, git_config_backend *so
188188

189189
backend->parent.readonly = 1;
190190
backend->parent.version = GIT_CONFIG_BACKEND_VERSION;
191-
backend->parent.open = config_readonly_open;
192-
backend->parent.get = config_get_readonly;
193-
backend->parent.set = config_set_readonly;
194-
backend->parent.set_multivar = config_set_multivar_readonly;
191+
backend->parent.open = config_snapshot_open;
192+
backend->parent.get = config_snapshot_get;
193+
backend->parent.set = config_snapshot_set;
194+
backend->parent.set_multivar = config_snapshot_set_multivar;
195195
backend->parent.snapshot = git_config_backend_snapshot;
196-
backend->parent.del = config_delete_readonly;
197-
backend->parent.del_multivar = config_delete_multivar_readonly;
198-
backend->parent.iterator = config_iterator_new_readonly;
199-
backend->parent.lock = config_lock_readonly;
200-
backend->parent.unlock = config_unlock_readonly;
201-
backend->parent.free = backend_readonly_free;
196+
backend->parent.del = config_snapshot_delete;
197+
backend->parent.del_multivar = config_snapshot_delete_multivar;
198+
backend->parent.iterator = config_snapshot_iterator;
199+
backend->parent.lock = config_snapshot_lock;
200+
backend->parent.unlock = config_snapshot_unlock;
201+
backend->parent.free = config_snapshot_free;
202202

203203
*out = &backend->parent;
204204

0 commit comments

Comments
 (0)