Re: [PATCH v5 2/4] commit test: Use write_script
- From
Jeff King <peff@peff.net>
- Date
- Jun 13, 2014, 06:50 UTC
- Message-ID
- <20140613065037.GA7908@sigill.intra.peff.net>
- In-Reply-To
- <1402601942-45553-3-git-send-email-caleb@calebthompson.io>
On Thu, Jun 12, 2014 at 02:39:00PM -0500, Caleb Thompson wrote:
> Use write_script from t/test-lib-functions.sh instead of cat, shebang, > and chmod. This protects us from potential shell meta-characters in the > name of our trash directory, which would be interpreted if we set > $EDITOR directly.
I'm not sure about this last sentence; isn't that what test_set_editor is doing, which was already there? I think the real rationale is readability: since $SHELL_PATH is handled for us, you can turn off interpolation in the here-doc containing the helper script. That avoids an extra layer of quoting.
-Peff