Re: [EGIT PATCH 1/6] Make sure we get the right storage for loose/pack/loose and packed refs

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

 



Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> wrote:
> Also adds a few some more test for refs, though not complete.

Hmm, tests fail, wrong expected values?
 
> +	public void testReadSymRefToPacked() throws IOException {
> +		assertEquals(Ref.Storage.LOOSE, ref.getStorage());

Actual was LOOSE_PACKED.

> +	public void testReadSymRefToLoosePacked() throws IOException {
> +		assertEquals(Ref.Storage.LOOSE, ref.getStorage());

Actual was LOOSE_PACKED.

> +	public void testDeleteLoosePacked() throws IOException {
> +		ObjectId pid = db.resolve("refs/heads/master^");
> +		RefUpdate updateRef = db.updateRef("refs/heads/master");
> +		updateRef.setNewObjectId(pid);
> +		updateRef.setForceUpdate(true);
> +		Result update = updateRef.update();
> +		assertEquals(Result.FORCED, update); // internal
> +
> +		RefUpdate updateRef2 = db.updateRef("refs/heads/master");
> +		Result delete = updateRef2.delete();
> +		assertEquals(Result.FORCED, delete);

Actual was Result.REJECTED_CURRENT_BRANCH.

> @@ -349,12 +355,20 @@ private synchronized Ref readRefBasic(final String origName,
> +
> +		if (!origName.equals(name)) {
> +			ref = new Ref(Ref.Storage.LOOSE, origName, name, id);
> +			looseRefs.put(origName, ref);
> +		}

Seems fine, but I'm starting to hate our current way of handling
symrefs.  Not for this series.  But its starting to worry me.

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