diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2011-05-06 12:42:47 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@elego.de> | 2011-05-10 14:47:20 +0200 |
commit | c0335005495c1b49986d19031557f9df6bf49922 (patch) | |
tree | e78fe9fc9487818a73f531af3d873353010ed583 /tests/t15-config.c | |
parent | ca8d2dfc0cea0c16e2d6bae16d95d652e292f473 (diff) | |
download | libgit2-c0335005495c1b49986d19031557f9df6bf49922.tar.gz |
Move config to a backend structure
Configuration options can come from different sources. Currently,
there is only support for reading them from a flat file, but it might
make sense to read it from a database at some point.
Move the parsing code into src/config_file.c and create an include
file include/git2/config_backend.h to allow for other backends to be
developed.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'tests/t15-config.c')
-rw-r--r-- | tests/t15-config.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/t15-config.c b/tests/t15-config.c index 8e0d3215c..1b971bd74 100644 --- a/tests/t15-config.c +++ b/tests/t15-config.c @@ -36,7 +36,7 @@ BEGIN_TEST(config0, "read a simple configuration") git_config *cfg; int i; - must_pass(git_config_open(&cfg, CONFIG_BASE "/config0")); + must_pass(git_config_open_bare(&cfg, CONFIG_BASE "/config0")); must_pass(git_config_get_int(cfg, "core.repositoryformatversion", &i)); must_be_true(i == 0); must_pass(git_config_get_bool(cfg, "core.filemode", &i)); @@ -58,7 +58,7 @@ BEGIN_TEST(config1, "case sensitivity") int i; const char *str; - must_pass(git_config_open(&cfg, CONFIG_BASE "/config1")); + must_pass(git_config_open_bare(&cfg, CONFIG_BASE "/config1")); must_pass(git_config_get_string(cfg, "this.that.other", &str)); must_be_true(!strcmp(str, "true")); @@ -84,7 +84,7 @@ BEGIN_TEST(config2, "parse a multiline value") git_config *cfg; const char *str; - must_pass(git_config_open(&cfg, CONFIG_BASE "/config2")); + must_pass(git_config_open_bare(&cfg, CONFIG_BASE "/config2")); must_pass(git_config_get_string(cfg, "this.That.and", &str)); must_be_true(!strcmp(str, "one one one two two three three")); @@ -99,7 +99,7 @@ BEGIN_TEST(config3, "parse a [section.subsection] header") git_config *cfg; const char *str; - must_pass(git_config_open(&cfg, CONFIG_BASE "/config3")); + must_pass(git_config_open_bare(&cfg, CONFIG_BASE "/config3")); must_pass(git_config_get_string(cfg, "section.subsection.var", &str)); must_be_true(!strcmp(str, "hello")); @@ -117,7 +117,7 @@ BEGIN_TEST(config4, "a variable name on its own is valid") const char *str; int i; - must_pass(git_config_open(&cfg, CONFIG_BASE "/config4")); + must_pass(git_config_open_bare(&cfg, CONFIG_BASE "/config4")); must_pass(git_config_get_string(cfg, "some.section.variable", &str)); must_be_true(str == NULL); @@ -134,7 +134,7 @@ BEGIN_TEST(config5, "test number suffixes") const char *str; long int i; - must_pass(git_config_open(&cfg, CONFIG_BASE "/config5")); + must_pass(git_config_open_bare(&cfg, CONFIG_BASE "/config5")); must_pass(git_config_get_long(cfg, "number.simple", &i)); must_be_true(i == 1); |