Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2011-07-05 19:44:51 +0400
committerCarlos Martín Nieto <cmn@elego.de>2011-07-05 19:47:10 +0400
commit7a7ef2dcebcc650a5b789194c726ccbd7b32d726 (patch)
tree5a80c901e9f774608e231286945989ced1a3e7f9 /tests
parent178376025cc70cc8da3ca58699717f2cc8e495a7 (diff)
Restore config10 test file
Removing a section variable doesn't remove its section header. Overwrite the config10 file so there are no changes after the test is run. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/t15-config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/t15-config.c b/tests/t15-config.c
index c85d336a6..cb1b0f372 100644
--- a/tests/t15-config.c
+++ b/tests/t15-config.c
@@ -26,6 +26,7 @@
#include "test_helpers.h"
#include <git2.h>
+#include "filebuf.h"
#define CONFIG_BASE TEST_RESOURCES "/config"
@@ -287,6 +288,7 @@ END_TEST
BEGIN_TEST(config16, "add a variable in a new section")
git_config *cfg;
int i;
+ git_filebuf buf;
/* By freeing the config, we make sure we flush the values */
must_pass(git_config_open_ondisk(&cfg, CONFIG_BASE "/config10"));
@@ -295,6 +297,11 @@ BEGIN_TEST(config16, "add a variable in a new section")
must_be_true(i == 5);
must_pass(git_config_del(cfg, "section.tmp"));
git_config_free(cfg);
+
+ /* As the section wasn't removed, owerwrite the file */
+ must_pass(git_filebuf_open(&buf, CONFIG_BASE "/config10", 0));
+ must_pass(git_filebuf_write(&buf, "[empty]\n", STRLEN("[empty]\n")));
+ must_pass(git_filebuf_commit(&buf));
END_TEST
BEGIN_SUITE(config)