Re: [PATCH v2 2/2] t: Add test for cloning from ref namespace

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

 



On 05/06, Junio C Hamano wrote:
Johannes Löthberg <johannes@xxxxxxxxxxxx> writes:

Hmm, it seems that git-rev-parse doesn't handle GIT_NAMESPACE yet, so
can't check it for the namespaced push right now. Not sure if I can
fix that myself though.

I do not see a need for rev-parse to pay attention to GIT_NAMESPACE
at all, though.


The ref namespace has its own HEAD, so I'd expect

 GIT_NAMESPACE=foo git rev-parse HEAD

to act sensibly

The destination that accepts the push with the enviornment variable,
i.e. your ../bare repository after this:

+		git commit -m "commit two"
+		GIT_NAMESPACE=new_namespace git push ../bare master

must be saving the result somewhere in ../bare/, and that is what
you want to check (and also no refs are affected outside that
hierarchy).

So perhaps along the lines of

       echo $(git rev-parse master) commit \
       	refs/namespaces/new_namespace/refs/heads/master >expect &&
	git -C ../bare for-each-ref refs/namespaces/ >actual &&
	test_cmp expect actual

or something?  You would want to also check that other refs are not
molested, so

	(
       	echo $(git rev-parse master^) commit \
               	refs/heads/master &&
	        echo $(git rev-parse master) commit \
	        	refs/namespaces/new_namespace/refs/heads/master
	) >expect &&
	git -C ../bare for-each-ref >actual &&
	test_cmp expect actual

might be a more appropriate test.

Sounds okay.

--
Sincerely,
 Johannes Löthberg
 PGP Key ID: 0x50FB9B273A9D0BB5
 https://theos.kyriasis.com/~kyrias/

Attachment: signature.asc
Description: PGP signature


[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]