diff options
| author | Vicent Martà <tanoku@gmail.com> | 2012-03-09 19:55:50 +0100 |
|---|---|---|
| committer | Vicent Martà <tanoku@gmail.com> | 2012-03-09 20:09:22 +0100 |
| commit | dda708e78f3c3f43d814d46c29ab9f2b9d47ed5c (patch) | |
| tree | 60a6e01583c15209a42740a46e182ac7cbc893de /src/config.c | |
| parent | 6af24ce31f43c3621f11720704a078058665bc3f (diff) | |
| download | libgit2-dda708e78f3c3f43d814d46c29ab9f2b9d47ed5c.tar.gz | |
error-handling: On-disk config file backend
Includes:
- Proper error reporting when encountering syntax errors in a
config file (file, line number, column).
- Rewritten `config_write`, now with 99% less goto-spaghetti
- Error state in `git_filebuf`: filebuf write functions no longer
need to be checked for error returns. If any of the writes performed
on a buffer fail, the last call to `git_filebuf_commit` or
`git_filebuf_hash` will fail accordingly and set the appropiate error
message. Baller!
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 850c9b15f..77598d6a6 100644 --- a/src/config.c +++ b/src/config.c @@ -401,13 +401,15 @@ int git_config_get_string(git_config *cfg, const char *name, const char **out) if (ret == 0) return 0; + /* File backend doesn't set error message on variable + * not found */ if (ret == GIT_ENOTFOUND) continue; return ret; } - giterr_set(GITERR_CONFIG, "Config value '%s' not found", name); + giterr_set(GITERR_CONFIG, "Config variable '%s' not found", name); return GIT_ENOTFOUND; } |
