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
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2012-09-18 16:10:40 +0400
committeryorah <yoram.harmelin@gmail.com>2012-10-23 13:48:50 +0400
commitf8ede94808348ac12db1d5dd91e5f66624d8b40d (patch)
tree2c8f93bdadb9c7e1d2cfc118c7bf2431ef45f210 /tests-clar/config
parent8a89aa1f57fc0b352800bc77e228554fe95caddd (diff)
Fix adding variable to config file with no trailing newline
This can occur after a manual modification of a config file.
Diffstat (limited to 'tests-clar/config')
-rw-r--r--tests-clar/config/write.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests-clar/config/write.c b/tests-clar/config/write.c
index 13b669cb2..eeda4d66a 100644
--- a/tests-clar/config/write.c
+++ b/tests-clar/config/write.c
@@ -3,11 +3,13 @@
void test_config_write__initialize(void)
{
cl_fixture_sandbox("config/config9");
+ cl_fixture_sandbox("config/config17");
}
void test_config_write__cleanup(void)
{
cl_fixture_cleanup("config9");
+ cl_fixture_cleanup("config17");
}
void test_config_write__replace_value(void)
@@ -136,3 +138,19 @@ void test_config_write__escape_value(void)
cl_assert_equal_s(str, "this \"has\" quotes and \t");
git_config_free(cfg);
}
+
+void test_config_write__add_value_in_file_with_no_clrf_at_the_end(void)
+{
+ git_config *cfg;
+ int i;
+
+ cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
+ cl_git_pass(git_config_set_int32(cfg, "core.newline", 7));
+ git_config_free(cfg);
+
+ cl_git_pass(git_config_open_ondisk(&cfg, "config17"));
+ cl_git_pass(git_config_get_int32(&i, cfg, "core.newline"));
+ cl_assert_equal_i(7, i);
+
+ git_config_free(cfg);
+}