From: Johannes Sixt <j6t@kdbg.org>
To: Eric Sunshine <sunshine@sunshineco.com>, Paul Tan <pyokagan@gmail.com>
Cc: Git List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Subject: Re: [PATCH v5 3/3] t0302: test credential-store support for XDG_CONFIG_HOME
Date: Wed, 25 Mar 2015 20:03:47 +0100 [thread overview]
Message-ID: <55130693.20607@kdbg.org> (raw)
In-Reply-To: <CAPig+cTWnLYU8wU+WjEVpDBuWS7of=wxrWnq7b9W-r=wQh5S1A@mail.gmail.com>
Am 25.03.2015 um 07:42 schrieb Eric Sunshine:
> On Tue, Mar 24, 2015 at 1:20 AM, Paul Tan <pyokagan@gmail.com> wrote:
>> t0302 now tests git-credential-store's support for the XDG user-specific
>> configuration file $XDG_CONFIG_HOME/git/credentials. Specifically:
>>
>> * Ensure that the XDG file is strictly opt-in. It should not be created
>> by git at all times if it does not exist.
>>
>> * Conversely, if the XDG file exists, ~/.git-credentials should
>> not be created at all times.
>>
>> * If both the XDG file and ~/.git-credentials exists, then both files
>> should be used for credential lookups. However, credentials should
>> only be written to ~/.git-credentials.
>>
>> * Credentials must be erased from both files.
>>
>> * $XDG_CONFIG_HOME can be a custom directory set by the user as per the
>> XDG base directory specification. Test that git-credential-store
>> respects that, but defaults to "~/.config/git/credentials" if it does
>> not exist or is empty.
>>
>> Helped-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
>> Helped-by: Junio C Hamano <gitster@pobox.com>
>> Helped-by: Eric Sunshine <sunshine@sunshineco.com>
>> Signed-off-by: Paul Tan <pyokagan@gmail.com>
>> ---
>> diff --git a/t/t0302-credential-store.sh b/t/t0302-credential-store.sh
>> index f61b40c..4e1f8ec 100755
>> --- a/t/t0302-credential-store.sh
>> +++ b/t/t0302-credential-store.sh
>> @@ -6,4 +6,118 @@ test_description='credential-store tests'
>>
>> helper_test store
>>
>> +test_expect_success 'get: use xdg file if home file is unreadable' '
>
> I meant to mention this earlier. Does this test need to be protected
> by the POSIXPERM prerequisite since it's using chmod?
>
> test_expect_success POSIXPERM 'get: ... unreadable' '
>
> Otherwise, the test will likely fail on Windows.
Well spotted! The test indeed fails on Windows. POSIXPERM is required.
>> + echo "https://home-user:home-pass@example.com" >"$HOME/.git-credentials" &&
>> + chmod -r "$HOME/.git-credentials" &&
>> + mkdir -p "$HOME/.config/git" &&
>> + echo "https://xdg-user:xdg-pass@example.com" >"$HOME/.config/git/credentials" &&
>> + check fill store <<-\EOF
>> + protocol=https
>> + host=example.com
>> + --
>> + protocol=https
>> + host=example.com
>> + username=xdg-user
>> + password=xdg-pass
>> + --
>> + EOF
>> +'
-- Hannes
prev parent reply other threads:[~2015-03-25 19:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-24 5:20 [PATCH v5 1/3] git-credential-store: support multiple credential files Paul Tan
2015-03-24 5:20 ` [PATCH v5 2/3] git-credential-store: support XDG_CONFIG_HOME Paul Tan
2015-03-24 5:20 ` [PATCH v5 3/3] t0302: test credential-store support for XDG_CONFIG_HOME Paul Tan
2015-03-24 9:52 ` Matthieu Moy
2015-03-25 6:54 ` Eric Sunshine
2015-03-25 16:17 ` Junio C Hamano
2015-03-25 20:25 ` Junio C Hamano
2015-03-26 5:20 ` Paul Tan
2015-03-26 13:27 ` Matthieu Moy
2015-03-25 6:42 ` Eric Sunshine
2015-03-25 19:03 ` Johannes Sixt [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55130693.20607@kdbg.org \
--to=j6t@kdbg.org \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=pyokagan@gmail.com \
--cc=sunshine@sunshineco.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.