1d32087125
We're feeding a list of files from `lsdiff` to `filterdiff` via `xargs`. That list is newline separated, and looks something like this: ``` $ lsdiff <(curl -s https://github.com/jfly/annoying-filenames/commit/1e86a219f5fc9c4137b409bc9c38036f3922724b.patch) a/README.md b/files/The Answer to the Ultimate Question of Life, The Universe, and Everything.txt ``` However, if the list contains files with apostrophes in it, xargs freaks out: ``` $ echo "there's an apostrophe here" | xargs -I{} python -c "import sys; print(sys.argv)" {} xargs: unmatched single quote; by default quotes are special to xargs unless you use the -0 option ``` The fix is simple, just explicitly specify a delimiter: ``` $ echo "there's an apostrophe here" | xargs -I{} --delimiter='\n' python -c "import sys; print(sys.argv)" {} ['-c', "there's an apostrophe here"] ``` I added 2 tests here: - `nix-build -A pkgs.tests.fetchpatch.fileWithApostrophe` fails without the code change. - `nix-build -A pkgs.tests.fetchpatch.fileWithSpace` passes both before and after this change, but I wanted to add it to prove that I didn't break anything.