Re: [PATCH 11/17] t5509: specify bare repository path explicitly
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 2, 2026, 20:44 UTC
- Message-ID
- <xmqq341dozxc.fsf@gitster.g>
- In-Reply-To
- <f6fc807af627701bf7f9ea413c7714e9bc01aea4.1775140403.git.gitgitgadget@gmail.com>
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> 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 && > + git --git-dir=pushee -c transfer.hideRefs=refs/tags \ > + ls-remote "ext::git %s pushee" >actual &&
Hmph. The command being ls-remote (which does not care what state your working tree files are), the above may work, but rewriting "-C there" with "--git-dir=there" changes the semantics of the program, no? A more conservative rewrite that would preserve what the original wanted to test would be to ...
( cd pushee && git --git-dir=. -c ... ls-remote ... )
... do this instead, I think.
Show 25 quoted lines
> printf "$commit1\trefs/heads/main\n" >expected && > test_cmp expected actual > ' > @@ -97,8 +97,8 @@ test_expect_success 'hide namespaced refs with transfer.hideRefs' ' > test_expect_success 'check that transfer.hideRefs does not match unstripped refs' ' > git -C pushee pack-refs --all && > GIT_NAMESPACE=namespace \ > - git -C pushee -c transfer.hideRefs=refs/namespaces/namespace/refs/tags \ > - ls-remote "ext::git %s ." >actual && > + git --git-dir=pushee -c transfer.hideRefs=refs/namespaces/namespace/refs/tags \ > + ls-remote "ext::git %s pushee" >actual && > printf "$commit1\trefs/heads/main\n" >expected && > printf "$commit0\trefs/tags/0\n" >>expected && > printf "$commit1\trefs/tags/1\n" >>expected && > @@ -107,8 +107,8 @@ test_expect_success 'check that transfer.hideRefs does not match unstripped refs > > 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 && > + git --git-dir=pushee -c transfer.hideRefs="^refs/namespaces/namespace/refs/tags" \ > + ls-remote "ext::git %s pushee" >actual && > printf "$commit1\trefs/heads/main\n" >expected && > test_cmp expected actual > '