aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Helgesson <robert@rycee.net>2020-05-01 00:11:14 +0200
committerRobert Helgesson <robert@rycee.net>2020-05-01 00:50:58 +0200
commit642d9ffe24eec1290e94d70e8129ba74922fddf2 (patch)
tree92582fa5c9e0ac4fc2f58251e4a3ade17422aa64 /tests
parent8b82f52e75e7127bf240293b3eef483aabffb405 (diff)
git: escape string values in configuration
This should handle the special characters that typically occur. Fixes #1206
Diffstat (limited to 'tests')
-rw-r--r--tests/modules/programs/git/git-expected-include.conf4
-rw-r--r--tests/modules/programs/git/git-expected.conf31
-rw-r--r--tests/modules/programs/git/git-with-email-expected.conf20
-rw-r--r--tests/modules/programs/git/git-with-str-extra-config-expected.conf4
-rw-r--r--tests/modules/programs/git/git.nix1
5 files changed, 31 insertions, 29 deletions
diff --git a/tests/modules/programs/git/git-expected-include.conf b/tests/modules/programs/git/git-expected-include.conf
index 2913a47e51f..f05c7b6c7fc 100644
--- a/tests/modules/programs/git/git-expected-include.conf
+++ b/tests/modules/programs/git/git-expected-include.conf
@@ -1,3 +1,3 @@
[user]
- email = user@example.org
- name = John Doe
+ email = "user@example.org"
+ name = "John Doe"
diff --git a/tests/modules/programs/git/git-expected.conf b/tests/modules/programs/git/git-expected.conf
index 96630b9ab92..45ba08db371 100644
--- a/tests/modules/programs/git/git-expected.conf
+++ b/tests/modules/programs/git/git-expected.conf
@@ -1,6 +1,7 @@
[alias]
- a1 = foo
- a2 = baz
+ a1 = "foo"
+ a2 = "baz"
+ escapes = "\"\\n\t"
[commit]
gpgSign = true
@@ -10,33 +11,33 @@
integer = 38
multiple = 1
multiple = 2
- name = value
+ name = "value"
[extra "backcompat.with.dots"]
- previously = worked
+ previously = "worked"
[extra "subsection"]
- value = test
+ value = "test"
[filter "lfs"]
- clean = git-lfs clean -- %f
- process = git-lfs filter-process
+ clean = "git-lfs clean -- %f"
+ process = "git-lfs filter-process"
required = true
- smudge = git-lfs smudge -- %f
+ smudge = "git-lfs smudge -- %f"
[gpg]
- program = path-to-gpg
+ program = "path-to-gpg"
[user]
- email = user@example.org
- name = John Doe
- signingKey = 00112233445566778899AABBCCDDEEFF
+ email = "user@example.org"
+ name = "John Doe"
+ signingKey = "00112233445566778899AABBCCDDEEFF"
[include]
- path = ~/path/to/config.inc
+ path = "~/path/to/config.inc"
[includeIf "gitdir:~/src/dir"]
- path = ~/path/to/conditional.inc
+ path = "~/path/to/conditional.inc"
[includeIf "gitdir:~/src/dir"]
- path = @git_include_path@
+ path = "@git_include_path@"
diff --git a/tests/modules/programs/git/git-with-email-expected.conf b/tests/modules/programs/git/git-with-email-expected.conf
index f13de91cd2d..44035a23c47 100644
--- a/tests/modules/programs/git/git-with-email-expected.conf
+++ b/tests/modules/programs/git/git-with-email-expected.conf
@@ -1,15 +1,15 @@
[sendemail "hm-account"]
- from = hm@example.org
- smtpEncryption = tls
- smtpServer = smtp.example.org
- smtpUser = home.manager.jr
+ from = "hm@example.org"
+ smtpEncryption = "tls"
+ smtpServer = "smtp.example.org"
+ smtpUser = "home.manager.jr"
[sendemail "hm@example.com"]
- from = hm@example.com
- smtpEncryption = tls
- smtpServer = smtp.example.com
- smtpUser = home.manager
+ from = "hm@example.com"
+ smtpEncryption = "tls"
+ smtpServer = "smtp.example.com"
+ smtpUser = "home.manager"
[user]
- email = hm@example.com
- name = H. M. Test
+ email = "hm@example.com"
+ name = "H. M. Test"
diff --git a/tests/modules/programs/git/git-with-str-extra-config-expected.conf b/tests/modules/programs/git/git-with-str-extra-config-expected.conf
index b343ed88f06..071268e831c 100644
--- a/tests/modules/programs/git/git-with-str-extra-config-expected.conf
+++ b/tests/modules/programs/git/git-with-str-extra-config-expected.conf
@@ -1,5 +1,5 @@
This can be anything.
[user]
- email = user@example.org
- name = John Doe
+ email = "user@example.org"
+ name = "John Doe"
diff --git a/tests/modules/programs/git/git.nix b/tests/modules/programs/git/git.nix
index 79f4f016238..d3c586fec58 100644
--- a/tests/modules/programs/git/git.nix
+++ b/tests/modules/programs/git/git.nix
@@ -28,6 +28,7 @@ in {
aliases = {
a1 = "foo";
a2 = "bar";
+ escapes = ''"\n '';
};
extraConfig = {
extra = {