git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC][PATCH v4 4/4] credential-cache: add tests for XDG functionality

From
DLDevin Lehmacher <djl329@cornell.edu>
Date
Mar 16, 2017, 21:03 UTC
Message-ID
<4652AE57-B470-4987-BD88-AA8AD491F25F@cornell.edu>
Show 27 quoted lines
> > > +test_expect_success 'credential-cache --socket option overrides default location' '
> > > + test_when_finished "rm -rf \"$HOME\"/dir/" &&
> > > + check approve "cache --socket \"$HOME/dir/socket\"" <<-\EOF &&
> > > + protocol=https
> > > + host=example.com
> > > + username=store-user
> > > + password=store-pass
> > > + EOF
> > > + test -S "$HOME/dir/socket" &&
> > > + git credential-cache exit
> > > +'
>
> This is almost right, except:
>
>   - the "exit" needs to be told which socket to use
>
>   - we should do the "exit" even when the test fails early (so in
>     test_when_finished)
>
>   - the test_when_finished block will interpolate $HOME when setting up
>     the block, which will break if it contains double-quotes or other
>     special characters. It should use \$HOME.
>
>     I suspect the "check" invocation needs to do so as well, though it
>     is even trickier (we shove it into a single-quoted "-c" argument).
>
>     I think you could get by in both cases with relative paths.

Using a relative path won't work since `git credential-cache --socket` only accepts absolute paths. It shouldn't be too hard to escape the string though.

-Devin
Message 1 of 1 in “Re: [GSoC][PATCH v4 4/4] credential-cache: add tests for XDG functionality”
  1. Devin LehmacherMar 16, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.