Re: [JGIT PATCH 05/11] Don't advertise HEAD from ReceivePack

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

 



Robin Rosenberg <robin.rosenberg.lists@xxxxxxxxxx> wrote:
> l?rdag 11 juli 2009 22:19:20 skrev "Shawn O. Pearce" <spearce@xxxxxxxxxxx>:
> > diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/ReceivePack.java b/org.spearce.jgit/src/org/spearce/jgit/transport/ReceivePack.java
> > index fd8aa86..1c490af 100644
> > --- a/org.spearce.jgit/src/org/spearce/jgit/transport/ReceivePack.java
> > +++ b/org.spearce.jgit/src/org/spearce/jgit/transport/ReceivePack.java
> > @@ -509,8 +509,11 @@ private void sendAdvertisedRefs() throws IOException {
> >  		adv.advertiseCapability(CAPABILITY_REPORT_STATUS);
> >  		if (allowOfsDelta)
> >  			adv.advertiseCapability(CAPABILITY_OFS_DELTA);
> > -		refs = db.getAllRefs();
> > +		refs = new HashMap<String, Ref>(db.getAllRefs());
> > +		final Ref head = refs.remove(Constants.HEAD);
> >  		adv.send(refs.values());
> > +		if (head != null && head.getName() == head.getOrigName())
> > +			adv.advertiseHave(head.getObjectId());
> 
> This relies on an implicit guarantee that == works here. Would equals cost
> too much? Or perhaps we should document this guarantee as part of the
> interface.

Ouch, good point, .equals would be better here.  Can you amend?
If its the only issue in the series just amend it to be .equals(),
if there are other things for me to fix I'll be happy to send an
updated patch.

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