예제 #1
0
        /// <summary>
        /// Generate an advertisement of available refs and capabilities.
        /// </summary>
        /// <param name="adv">the advertisement formatter.</param>
        public void SendAdvertisedRefs(RefAdvertiser adv)
        {
            RevFlag advertised = walk.newFlag("ADVERTISED");

            adv.init(walk, advertised);
            adv.advertiseCapability(BasePackPushConnection.CAPABILITY_SIDE_BAND_64K);
            adv.advertiseCapability(BasePackPushConnection.CAPABILITY_DELETE_REFS);
            adv.advertiseCapability(BasePackPushConnection.CAPABILITY_REPORT_STATUS);
            if (allowOfsDelta)
            {
                adv.advertiseCapability(BasePackPushConnection.CAPABILITY_OFS_DELTA);
            }
            refs = refFilter.filter(db.getAllRefs());
            Ref head = refs.remove(Constants.HEAD);

            adv.send(refs);
            if (head != null && !head.isSymbolic())
            {
                adv.advertiseHave(head.ObjectId);
            }
            adv.includeAdditionalHaves();
            if (adv.isEmpty())
            {
                adv.advertiseId(ObjectId.ZeroId, "capabilities^{}");
            }
            adv.end();
        }
예제 #2
0
 /// <summary>
 /// Generate an advertisement of available refs and capabilities.
 /// </summary>
 /// <param name="adv">the advertisement formatter.</param>
 public void SendAdvertisedRefs(RefAdvertiser adv)
 {
     adv.init(_walk, ADVERTISED);
     adv.advertiseCapability(OptionIncludeTag);
     adv.advertiseCapability(OPTION_MULTI_ACK_DETAILED);
     adv.advertiseCapability(OptionMultiAck);
     adv.advertiseCapability(OptionOfsDelta);
     adv.advertiseCapability(OptionSideBand);
     adv.advertiseCapability(OptionSideBand64K);
     adv.advertiseCapability(OptionThinPack);
     adv.advertiseCapability(OptionNoProgress);
     adv.setDerefTags(true);
     _refs = _refFilter.filter(_db.getAllRefs());
     adv.send(_refs);
     adv.end();
 }
예제 #3
0
 /// <summary>
 /// Generate an advertisement of available refs and capabilities.
 /// </summary>
 /// <param name="adv">the advertisement formatter.</param>
 public void sendAdvertisedRefs(RefAdvertiser adv)
 {
     adv.init(_walk, ADVERTISED);
     adv.advertiseCapability(OptionIncludeTag);
     adv.advertiseCapability(OPTION_MULTI_ACK_DETAILED);
     adv.advertiseCapability(OptionMultiAck);
     adv.advertiseCapability(OptionOfsDelta);
     adv.advertiseCapability(OptionSideBand);
     adv.advertiseCapability(OptionSideBand64K);
     adv.advertiseCapability(OptionThinPack);
     adv.advertiseCapability(OptionNoProgress);
     adv.setDerefTags(true);
     _refs = _refFilter.filter(_db.getAllRefs());
     adv.send(_refs);
     adv.end();
 }