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

From: "Shawn O. Pearce" <[email-masked]>
Date: Wed, 20 May 2009 14:43:59 -0700

Robin Rosenberg <[email-masked]> 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.