Re: [PATCH v3] receive-pack: Create a HEAD ref for 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:

+
+		echo "ref: refs/namespaces/new_namespace/refs/heads/master" >expect &&
+		test_cmp expect ../bare/refs/namespaces/new_namespace/HEAD  &&

Use "symbolic-ref refs/namespaces/new_namespace/HEAD"; HEAD is not
required to be expressed as a textual symref.


Gotcha.

+
+		(
+			printf "%s commit\t%s\n" $(git rev-parse master^) \
+			                         refs/heads/master &&
+			printf "%s commit\t%s\n" $(git rev-parse master) \
+			                         refs/namespaces/new_namespace/HEAD &&
+			printf "%s commit\t%s\n" $(git rev-parse master) \
+			                         refs/namespaces/new_namespace/refs/heads/master
+		) >expect &&

Use of 'printf' is clever and I like it.  Have you considered
letting it do the iteration as well?  I.e.

	printf "%s commit\t%s\n" \
       	one two \
               three four \
               five six \
	>expect &&

might be easier to read.


Didn't think about that actually. Will do.

+		git -C ../bare for-each-ref refs/ >actual &&
+		test_cmp expect actual
+	) &&
+	GIT_NAMESPACE=new_namespace git clone bare clone &&
+	(
+		cd clone &&
+		git show

We can accept any random commit at HEAD as long as it exists at this
point?  Don't we need to make sure that a ref whose tip is still "one"
is not propagated to this new clone?


Oh crap, I just remembered that I forgot to address that part, sorry.

+	)
+'
+
+
 test_done

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