{"thread":{"id":"45401","subject":"Re: [GSoC][PATCH v4 4/4] credential-cache: add tests for XDG functionality","startedAt":"2017-03-16T21:04:21Z","lastAt":"2017-03-16T21:04:21Z","messageCount":1,"participants":["Devin Lehmacher"],"isPatch":true,"patchVersion":4,"patchTotal":4},"messages":[{"id":"314257","messageId":"4652AE57-B470-4987-BD88-AA8AD491F25F@cornell.edu","threadId":"45401","inReplyTo":null,"subject":"Re: [GSoC][PATCH v4 4/4] credential-cache: add tests for XDG functionality","fromName":"Devin Lehmacher","fromEmail":"djl329@cornell.edu","sentAt":"2017-03-16T21:03:47Z","receivedAt":"2017-03-16T21:04:21Z","isPatch":true,"sender":{"key":"djl329@cornell.edu","avatar":null},"body":"> > > +test_expect_success 'credential-cache --socket option overrides default location' '\n> > > + test_when_finished \"rm -rf \\\"$HOME\\\"/dir/\" &&\n> > > + check approve \"cache --socket \\\"$HOME/dir/socket\\\"\" <<-\\EOF &&\n> > > + protocol=https\n> > > + host=example.com\n> > > + username=store-user\n> > > + password=store-pass\n> > > + EOF\n> > > + test -S \"$HOME/dir/socket\" &&\n> > > + git credential-cache exit\n> > > +'\n>\n> This is almost right, except:\n>\n>   - the \"exit\" needs to be told which socket to use\n>\n>   - we should do the \"exit\" even when the test fails early (so in\n>     test_when_finished)\n>\n>   - the test_when_finished block will interpolate $HOME when setting up\n>     the block, which will break if it contains double-quotes or other\n>     special characters. It should use \\$HOME.\n>\n>     I suspect the \"check\" invocation needs to do so as well, though it\n>     is even trickier (we shove it into a single-quoted \"-c\" argument).\n>\n>     I think you could get by in both cases with relative paths.\n\nUsing a relative path won't work since `git credential-cache --socket`\nonly accepts absolute paths. It shouldn't be too hard to escape the\nstring though.\n\n-Devin\n"}]}