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: Thu, 21 May 2009 08:48:31 -0700

Robin Rosenberg <[email-masked]> wrote:
> onsdag 20 maj 2009 23:43:59 skrev "Shawn O. Pearce" <[email-masked]>:
> 
> I agree. For decorating the history it's convenient, but it's inconsistent. For some reason
> it was harder to see without the unit tests. All kinds of things slip by when testing is
> done on the surface only.
> 
> I'll update, and and even more tests. 

Thanks.
 
> Should we use multiple Ref objects for symrefs? I.e. a Ref referring to another in a chain,
> with all symrefs in between visible?

Yea, I'm starting to think that we should expose a symref as a Ref that
contains a nested Ref.  The getObjectId() / getPeeledObjectId() of any
of those Refs in that chain should return the leaf node value, but the
name of each Ref should be the name of the symref.

So readRef(HEAD) yields:

  Ref {
    name = "HEAD"
    next = Ref {
      name = "refs/heads/master"
      next = null
      objectId = ....
    }
  }

That may break some callers though, as they'd now get HEAD instead
of master as the name of the return value.

-- 
Shawn.