What was broken shellQuote doubled backslashes
Inside POSIX sh single quotes a backslash has no special meaning, yet shellQuote doubled it. For the value \n the function returned '\\n', so the shell received different text from the one in the template.
How we fixed it Backslashes are kept as they are
shellQuote now copies a backslash unchanged, while a single quote still closes the quoted run and gets a backslash before it. Tests cover \n and \', and we checked a few quoted values through sh -c.
#5233
What was broken Diffing a new file passed a missing path
Choosing diff in apply --interactive for a file that is not on disk yet passed the destination path to diff.command. The external diff program was handed a file that does not exist.
How we fixed it A new file is compared with /dev/null
The command now gets /dev/null, or NUL: on Windows, as in chezmoi diff, through the same DevNullAbsPath function. A test in diffcommand_unix.txtar uses a diff command that fails if any argument does not exist.
#5232