git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Devin Lehmacher <djl329@cornell.edu>
To: Jeff King <peff@peff.net>
Cc: <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>,
	Devin Lehmacher <lehmacdj@gmail.com>
Subject: Re: [GSoC][PATCH v4 4/4] credential-cache: add tests for XDG functionality
Date: Thu, 16 Mar 2017 17:03:47 -0400	[thread overview]
Message-ID: <4652AE57-B470-4987-BD88-AA8AD491F25F@cornell.edu> (raw)

> > > +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

             reply	other threads:[~2017-03-16 21:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 21:03 Devin Lehmacher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-03-14  0:32 [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket Devin Lehmacher
2017-03-16  5:18 ` [GSoC][PATCH v4 0/4] Moving credential-cache socket to xdg path Devin Lehmacher
2017-03-16  5:18   ` [GSoC][PATCH v4 4/4] credential-cache: add tests for XDG functionality Devin Lehmacher
2017-03-16 16:29     ` Junio C Hamano
2017-03-16 17:58       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4652AE57-B470-4987-BD88-AA8AD491F25F@cornell.edu \
    --to=djl329@cornell.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lehmacdj@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).