summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Pfender <jpfender@elegosoft.com>2011-05-19 15:46:36 +0200
committerVicent Marti <tanoku@gmail.com>2011-05-23 21:38:44 +0300
commitec9edd5657a4e2b192ec43f4038f8ef3975020c0 (patch)
tree0a146798a44b302a0d8b1c828ff0949c100b7505
parenta6d647d258c05698a3b2a7041ee69b5971dc9eca (diff)
downloadlibgit2-ec9edd5657a4e2b192ec43f4038f8ef3975020c0.tar.gz
config_file.c: Move to new error handling mechanism
-rw-r--r--src/config_file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/config_file.c b/src/config_file.c
index a5addf18f..1ee9afa28 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -263,7 +263,7 @@ static int config_open(git_config_file *cfg)
gitfo_free_buf(&b->reader.buffer);
free(cfg);
- return error;
+ return git__rethrow(error, "Failed to open config");
}
static void backend_free(git_config_file *_backend)
@@ -363,7 +363,7 @@ static int config_set(git_config_file *cfg, const char *name, const char *value)
if (error < GIT_SUCCESS)
cvar_free(var);
- return error;
+ return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to set config value");
}
/*
@@ -382,7 +382,7 @@ static int config_get(git_config_file *cfg, const char *name, const char **out)
*out = var->value;
- return error;
+ return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to get config value for %s", name);
}
int git_config_file__ondisk(git_config_file **out, const char *path)
@@ -711,7 +711,7 @@ static int parse_section_header(diskfile_backend *cfg, char **section_out)
error = parse_section_header_ext(line, name, section_out);
free(line);
free(name);
- return error;
+ return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to parse header");
}
if (!config_keychar(c) && c != '.') {
@@ -874,7 +874,7 @@ static int config_parse(diskfile_backend *cfg_file)
if (current_section)
free(current_section);
- return error;
+ return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to parse config");
}
static int is_multiline_var(const char *str)