Re: [PATCH v2 4/4] t5509: add basic tests for hideRefs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, November 3, 2015, Lukas Fleischer <lfleischer@xxxxxxx> wrote:
> Test whether regular and full hideRefs patterns work as expected when
> namespaces are used.
>
> Helped-by: Eric Sunshine <sunshine@xxxxxxxxxxxxxx>
> Signed-off-by: Lukas Fleischer <lfleischer@xxxxxxx>
> ---
> diff --git a/t/t5509-fetch-push-namespaces.sh b/t/t5509-fetch-push-namespaces.sh
> @@ -82,4 +82,45 @@ test_expect_success 'mirroring a repository using a ref namespace' '
> +test_expect_success 'hide namespaced refs with transfer.hideRefs' '
> +       GIT_NAMESPACE=namespace \
> +               git -C pushee -c transfer.hideRefs=refs/tags \
> +               ls-remote "ext::git %s ." >actual &&
> +       printf "$commit1\trefs/heads/master\n" >expected &&
> +       test_cmp expected actual
> +'
> +
> +test_expect_success 'check that transfer.hideRefs does not match unstripped refs' '
> +       GIT_NAMESPACE=namespace \
> +               git -C pushee -c transfer.hideRefs=refs/namespaces/namespace/refs/tags \
> +               ls-remote "ext::git %s ." >actual &&
> +       printf "$commit1\trefs/heads/master\n" >expected &&
> +       printf "$commit0\trefs/tags/0\n" >>expected &&
> +       printf "$commit1\trefs/tags/1\n" >>expected &&
> +       test_cmp expected actual
> +'
> +
> +test_expect_success 'hide full refs with transfer.hideRefs' '
> +       GIT_NAMESPACE=namespace \
> +               git -C pushee -c transfer.hideRefs="^refs/namespaces/namespace/refs/tags" \
> +               ls-remote "ext::git %s ." >actual &&
> +       printf "$commit1\trefs/heads/master\n" >expected &&
> +       test_cmp expected actual
> +'
> +
> +test_expect_success 'try to update a hidden ref' '
> +       test_config -C pushee transfer.hideRefs refs/heads/master &&
> +       test_must_fail git -C original push pushee-namespaced master

In above tests, you use -c to set the configuration temporarily for
the git invocation, but not in this and following tests. Is that
because the -c isn't visible to sub-commands which git-push invokes?
(Genuine question; I want to make sure I understand the reasoning.)

> +'
> +
> +test_expect_success 'try to update a ref that is not hidden' '
> +       test_config -C pushee transfer.hideRefs refs/namespaces/namespace/refs/heads/master &&
> +       git -C original push pushee-namespaced master
> +'
> +
> +test_expect_success 'try to update a hidden full ref' '
> +       test_config -C pushee transfer.hideRefs "^refs/namespaces/namespace/refs/heads/master" &&
> +       test_must_fail git -C original push pushee-namespaced master
> +'
> +
>  test_done
> --
> 2.6.2
>
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]