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:
authorCarlos Martín Nieto <cmn@dwim.me>2013-01-25 16:29:28 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2013-01-25 16:29:28 +0400
commit9f35754a0ebb8004162e93ad365e0757fa39920a (patch)
tree19491e9d9dd625c47945dc727bbb6c88acda5eea /tests-clar/config
parent26ec6a6db364534077add6bc486cfeefdebfeee8 (diff)
config: support trailing backslashes
Check whether the backslash at the end of the line is being escaped or not so as not to consider it a continuation marker when it's e.g. a Windows-style path.
Diffstat (limited to 'tests-clar/config')
-rw-r--r--tests-clar/config/stress.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests-clar/config/stress.c b/tests-clar/config/stress.c
index 317e877f7..db354376a 100644
--- a/tests-clar/config/stress.c
+++ b/tests-clar/config/stress.c
@@ -73,3 +73,20 @@ void test_config_stress__escape_subsection_names(void)
cl_assert(!strcmp("foo", str));
git_config_free(config);
}
+
+void test_config_stress__trailing_backslash(void)
+{
+ git_config *config;
+ const char *str;
+ const char *path = "C:\\iam\\some\\windows\\path\\";
+
+ cl_assert(git_path_exists("git-test-config"));
+ cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG));
+ cl_git_pass(git_config_set_string(config, "windows.path", path));
+ git_config_free(config);
+
+ cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG));
+ cl_git_pass(git_config_get_string(&str, config, "windows.path"));
+ cl_assert_equal_s(path, str);
+ git_config_free(config);
+}