Re: [PATCH] t0003: properly quote $HOME
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Oct 17, 2010, 21:03 UTC
- Message-ID
- <201010172303.58780.j6t@kdbg.org>
- In-Reply-To
- <decc39532e1706c50964bad14c51d0bcd9ab09a6.1287342744.git.trast@student.ethz.ch>
On Sonntag, 17. Oktober 2010, Thomas Rast wrote:
Show 22 quoted lines
> 6df42ab (Add global and system-wide gitattributes, 2010-09-01) forgot > to quote one instance of $HOME in the tests. This broke the test for > me with the shell complaining about an ambiguous redirect (but only > when run with --root for some reason). > > Signed-off-by: Thomas Rast <trast@student.ethz.ch> > --- > t/t0003-attributes.sh | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh > index 25205ac..e75153b 100755 > --- a/t/t0003-attributes.sh > +++ b/t/t0003-attributes.sh > @@ -38,7 +38,7 @@ test_expect_success 'setup' ' > ) >a/b/.gitattributes > ( > echo "global test=global" > - ) >$HOME/global-gitattributes > + ) >"$HOME"/global-gitattributes > > '
FWIW, the failure is due to bash trying to be helpful. Variable expansions after redirections are not word-split, but bash incorrectly detects an "ambiguous redirect" if the expanded text contains IFS characters. Your fix is of course the right way to work it around. But you might update the commit message.
-- Hannes