Commit d75bbea1 by Patrick Steinhardt

config_file: remove unnecessary snapshot indirection

The implementation for config file snapshots has an unnecessary
redirection from `config_snapshot` to `git_config_file__snapshot`.
Inline the call to `git_config_file__snapshot` and remove it.
parent b944e137
...@@ -81,7 +81,6 @@ static int config_read(diskfile_entries *entries, const git_repository *repo, gi ...@@ -81,7 +81,6 @@ static int config_read(diskfile_entries *entries, const git_repository *repo, gi
static int config_write(diskfile_backend *cfg, const char *orig_key, const char *key, const regex_t *preg, const char *value); static int config_write(diskfile_backend *cfg, const char *orig_key, const char *key, const regex_t *preg, const char *value);
static char *escape_value(const char *ptr); static char *escape_value(const char *ptr);
int git_config_file__snapshot(git_config_backend **out, diskfile_backend *in);
static int config_snapshot(git_config_backend **out, git_config_backend *in); static int config_snapshot(git_config_backend **out, git_config_backend *in);
static int config_error_readonly(void) static int config_error_readonly(void)
...@@ -632,13 +631,6 @@ out: ...@@ -632,13 +631,6 @@ out:
return result; return result;
} }
static int config_snapshot(git_config_backend **out, git_config_backend *in)
{
diskfile_backend *b = (diskfile_backend *) in;
return git_config_file__snapshot(out, b);
}
static int config_lock(git_config_backend *_cfg) static int config_lock(git_config_backend *_cfg)
{ {
diskfile_backend *cfg = (diskfile_backend *) _cfg; diskfile_backend *cfg = (diskfile_backend *) _cfg;
...@@ -792,7 +784,7 @@ static int config_readonly_open(git_config_backend *cfg, git_config_level_t leve ...@@ -792,7 +784,7 @@ static int config_readonly_open(git_config_backend *cfg, git_config_level_t leve
return 0; return 0;
} }
int git_config_file__snapshot(git_config_backend **out, diskfile_backend *in) static int config_snapshot(git_config_backend **out, git_config_backend *in)
{ {
diskfile_readonly_backend *backend; diskfile_readonly_backend *backend;
...@@ -802,7 +794,7 @@ int git_config_file__snapshot(git_config_backend **out, diskfile_backend *in) ...@@ -802,7 +794,7 @@ int git_config_file__snapshot(git_config_backend **out, diskfile_backend *in)
backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION; backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION;
git_mutex_init(&backend->header.values_mutex); git_mutex_init(&backend->header.values_mutex);
backend->snapshot_from = in; backend->snapshot_from = (diskfile_backend *) in;
backend->header.parent.readonly = 1; backend->header.parent.readonly = 1;
backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION; backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment