Re: [PATCH v2] remote: make refspec follow the same disambiguation rule as local refs
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Aug 1, 2018, 18:13 UTC
- Message-ID
- <20180801181348.106679-1-jonathantanmy@google.com>
- In-Reply-To
- <xmqq8t5q821c.fsf@gitster-ct.c.googlers.com>
Show 34 quoted lines
> +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.