diff options
Diffstat (limited to 'home-manager/tests/modules/programs/git')
6 files changed, 71 insertions, 35 deletions
diff --git a/home-manager/tests/modules/programs/git/git-expected-include.conf b/home-manager/tests/modules/programs/git/git-expected-include.conf new file mode 100644 index 00000000000..f05c7b6c7fc --- /dev/null +++ b/home-manager/tests/modules/programs/git/git-expected-include.conf @@ -0,0 +1,3 @@ +[user] + email = "user@example.org" + name = "John Doe" diff --git a/home-manager/tests/modules/programs/git/git-expected.conf b/home-manager/tests/modules/programs/git/git-expected.conf index d02ebf31649..c3e534af058 100644 --- a/home-manager/tests/modules/programs/git/git-expected.conf +++ b/home-manager/tests/modules/programs/git/git-expected.conf @@ -1,42 +1,58 @@ [alias] -a1=foo -a2=baz + a1 = "foo" + a2 = "baz" + escapes = "\"\\n\t" [commit] -gpgSign=true + gpgSign = true + +[core] + pager = "@deltaCommand@" + +[delta] + features = "decorations" + whitespace-error-style = "22 reverse" + +[delta "decorations"] + commit-decoration-style = "bold yellow box ul" + file-decoration-style = "none" + file-style = "bold yellow ul" [extra] -boolean=true -integer=38 -multiple=1 -multiple=2 -name=value + boolean = true + integer = 38 + multiple = 1 + multiple = 2 + 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 -required=true -smudge=git-lfs smudge -- %f + clean = "git-lfs clean -- %f" + process = "git-lfs filter-process" + required = true + smudge = "git-lfs smudge -- %f" [gpg] -program=path-to-gpg + program = "path-to-gpg" + +[interactive] + diffFilter = "@deltaCommand@ --color-only" [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/home-manager/tests/modules/programs/git/git-with-email-expected.conf b/home-manager/tests/modules/programs/git/git-with-email-expected.conf index 01c1eec5823..f48b7c33334 100644 --- a/home-manager/tests/modules/programs/git/git-with-email-expected.conf +++ b/home-manager/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 = "ssl" + 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/home-manager/tests/modules/programs/git/git-with-email.nix b/home-manager/tests/modules/programs/git/git-with-email.nix index ca577eef4d3..d7ed7e185de 100644 --- a/home-manager/tests/modules/programs/git/git-with-email.nix +++ b/home-manager/tests/modules/programs/git/git-with-email.nix @@ -13,6 +13,8 @@ with lib; userName = "H. M. Test"; }; + home.stateVersion = "20.09"; + nmt.script = '' function assertGitConfig() { local value diff --git a/home-manager/tests/modules/programs/git/git-with-str-extra-config-expected.conf b/home-manager/tests/modules/programs/git/git-with-str-extra-config-expected.conf index 957438de13a..071268e831c 100644 --- a/home-manager/tests/modules/programs/git/git-with-str-extra-config-expected.conf +++ b/home-manager/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/home-manager/tests/modules/programs/git/git.nix b/home-manager/tests/modules/programs/git/git.nix index 7c0bf52de55..feefff54b61 100644 --- a/home-manager/tests/modules/programs/git/git.nix +++ b/home-manager/tests/modules/programs/git/git.nix @@ -15,8 +15,10 @@ let pkgs.substituteAll { src = path; - git_include_path = - pkgs.writeText "contents" (generators.toINI { } gitInclude); + deltaCommand = "${pkgs.gitAndTools.delta}/bin/delta"; + + git_include_path = pkgs.writeText "contents" + (builtins.readFile ./git-expected-include.conf); }; in { @@ -28,6 +30,7 @@ in { aliases = { a1 = "foo"; a2 = "bar"; + escapes = ''"\n ''; }; extraConfig = { extra = { @@ -55,6 +58,18 @@ in { userEmail = "user@example.org"; userName = "John Doe"; lfs.enable = true; + delta = { + enable = true; + options = { + features = "decorations"; + whitespace-error-style = "22 reverse"; + decorations = { + commit-decoration-style = "bold yellow box ul"; + file-style = "bold yellow ul"; + file-decoration-style = "none"; + }; + }; + }; } { |