1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/tests/modules/programs/diff-highlight/diff-highlight-migration.nix
Austin Horstman 486487b5e9 tests/diff-highlight: add
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-10-19 10:24:15 -05:00

33 lines
1.2 KiB
Nix

{
lib,
options,
...
}:
{
programs.git = {
enable = true;
diff-highlight = {
enable = true;
pagerOpts = [
"--tabs=4"
"-RFX"
];
};
};
test.asserts.warnings.expected = [
"The option `programs.git.diff-highlight.pagerOpts' defined in ${lib.showFiles options.programs.git.diff-highlight.pagerOpts.files} has been renamed to `programs.diff-highlight.pagerOpts'."
"The option `programs.git.diff-highlight.enable' defined in ${lib.showFiles options.programs.git.diff-highlight.enable.files} has been renamed to `programs.diff-highlight.enable'."
"`programs.diff-highlight.enableGitIntegration` automatic enablement is deprecated. Please explicitly set `programs.diff-highlight.enableGitIntegration = true`."
];
nmt.script = ''
# Git config should contain diff-highlight configuration (backward compatibility)
assertFileExists home-files/.config/git/config
assertFileContains home-files/.config/git/config '[core]'
assertFileRegex home-files/.config/git/config 'pager = .*/diff-highlight.*less'
assertFileContains home-files/.config/git/config '[interactive]'
assertFileRegex home-files/.config/git/config 'diffFilter = .*/diff-highlight'
'';
}