From: Junio C Hamano <gitster@pobox.com>
To: Jonathan Tan <jonathantanmy@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] remote: make refspec follow the same disambiguation rule as local refs
Date: Wed, 01 Aug 2018 11:26:13 -0700 [thread overview]
Message-ID: <xmqqo9em6j0a.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180801181348.106679-1-jonathantanmy@google.com> (Jonathan Tan's message of "Wed, 1 Aug 2018 11:13:48 -0700")
Jonathan Tan <jonathantanmy@google.com> writes:
>> +test_expect_success 'LHS of refspec follows ref disambiguation rules' '
>> + mkdir lhs-ambiguous &&
>> + (
>> + cd lhs-ambiguous &&
>> + git init server &&
>> + test_commit -C server unwanted &&
>> + test_commit -C server wanted &&
>> +
>> + git init client &&
>> +
>> + # Check a name coming after "refs" alphabetically ...
>> + git -C server update-ref refs/heads/s wanted &&
>> + git -C server update-ref refs/heads/refs/heads/s unwanted &&
>> + git -C client fetch ../server +refs/heads/s:refs/heads/checkthis &&
>> + git -C server rev-parse wanted >expect &&
>> + git -C client rev-parse checkthis >actual &&
>> + test_cmp expect actual &&
>> +
>> + # ... and one before.
>> + git -C server update-ref refs/heads/q wanted &&
>> + git -C server update-ref refs/heads/refs/heads/q unwanted &&
>> + git -C client fetch ../server +refs/heads/q:refs/heads/checkthis &&
>> + git -C server rev-parse wanted >expect &&
>> + git -C client rev-parse checkthis >actual &&
>> + test_cmp expect actual &&
>> +
>> + # Tags are preferred over branches like refs/{heads,tags}/*
>> + git -C server update-ref refs/tags/t wanted &&
>> + git -C server update-ref refs/heads/t unwanted &&
>> + git -C client fetch ../server +t:refs/heads/checkthis &&
>> + git -C server rev-parse wanted >expect &&
>> + git -C client rev-parse checkthis >actual
>> + )
>> +'
>
> Thanks, this looks good to me. Also thanks for adding the "+" in the
> fetch commands in the test.
Yup, otherwise the fetch may fail because "checkthis" may have to be
rewound when we fetch different things.
next prev parent reply other threads:[~2018-08-01 18:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-01 16:49 [PATCH v2] remote: make refspec follow the same disambiguation rule as local refs Junio C Hamano
2018-08-01 18:13 ` Jonathan Tan
2018-08-01 18:26 ` Junio C Hamano [this message]
2018-08-01 23:08 ` Jonathan Nieder
2018-08-02 2:21 ` Junio C Hamano
2018-08-02 2:26 ` Jonathan Nieder
2018-08-02 22:21 ` [PATCH v3] " Junio C Hamano
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=xmqqo9em6j0a.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jonathantanmy@google.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.
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).