Re: [GSoC][PATCH v6 3/3] credential-cache: add tests for XDG functionality
- Date: Fri, 17 Mar 2017 09:38:17 -0400
- From: Jeff King <peff@xxxxxxxx>
- Subject: Re: [GSoC][PATCH v6 3/3] credential-cache: add tests for XDG functionality
On Fri, Mar 17, 2017 at 08:36:34AM -0400, Devin Lehmacher wrote:
> +test_expect_success 'credential-cache --socket option overrides default location' '
> + test_when_finished "
> + git credential-cache exit --socket \"\$HOME/dir/socket\" &&
> + rmdir \"\$HOME/dir\"
> + " &&
> + check approve "cache --socket \"\$HOME/dir/socket\"" <<-\EOF &&
I wondered how this one got through the quoting/eval mess of the
"check()" function. But it works because we pass a raw unexpanded $HOME
into the config variable, and the credential subsystem then runs "cache
--socket ..." using a shell, which is where it gets expanded.
> + mkdir -p -m 700 "$HOME/.git-credential-cache/" &&
This is our first use of "mkdir -m". It's in POSIX, so it should
probably be fine. I'm not sure if platforms without POSIXPERM would
complain, but I think in practice anything with unix sockets will handle
it just fine.
The rest of the tests look OK to me.