Re: [EGIT PATCH 1/6] Make sure we get the right storage for loose/pack/loose and packed refs
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- May 21, 2009, 15:48 UTC
- Message-ID
- <20090521154831.GV30527@spearce.org>
- In-Reply-To
- <200905211722.33995.robin.rosenberg@dewire.com>
Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
Show 7 quoted lines
> onsdag 20 maj 2009 23:43:59 skrev "Shawn O. Pearce" <spearce@spearce.org>: > > 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.