diff options
author | Patrick Steinhardt <ps@pks.im> | 2018-08-10 19:38:57 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-09-28 11:14:13 +0200 |
commit | 2be39cefd3ce1fecd4cd76122f8574c53add4dd2 (patch) | |
tree | aad17b7d30556e9142fb7e3a02a53ae9fee68729 /src/config_parse.c | |
parent | b78f4ab082030bc02ee2e1a51eca441bfb6f1e8f (diff) | |
download | libgit2-2be39cefd3ce1fecd4cd76122f8574c53add4dd2.tar.gz |
config: introduce new read-only in-memory backend
Now that we have abstracted away how to store and retrieve config
entries, it became trivial to implement a new in-memory backend by
making use of this. And thus we do so.
This commit implements a new read-only in-memory backend that can parse
a chunk of memory into a `git_config_backend` structure.
Diffstat (limited to 'src/config_parse.c')
-rw-r--r-- | src/config_parse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/config_parse.c b/src/config_parse.c index 6e85bbe0d..0d7054927 100644 --- a/src/config_parse.c +++ b/src/config_parse.c @@ -16,8 +16,9 @@ const char *git_config_escaped = "\n\t\b\"\\"; static void set_parse_error(git_config_parser *reader, int col, const char *error_str) { + const char *file = reader->file ? reader->file->path : "in-memory"; giterr_set(GITERR_CONFIG, "failed to parse config file: %s (in %s:%"PRIuZ", column %d)", - error_str, reader->file->path, reader->ctx.line_num, col); + error_str, file, reader->ctx.line_num, col); } |