internal virtual void Add(FetchHeadRecord r) { if (!r.notForMerge) { forMerge.AddItem(r); } }
private void RemoveFetchHeadRecord(ObjectId want) { Iterator <FetchHeadRecord> i = fetchHeadUpdates.Iterator(); while (i.HasNext()) { FetchHeadRecord fh = i.Next(); if (fh.newValue.Equals(want)) { i.Remove(); } } }
/// <exception cref="NGit.Errors.TransportException"></exception> private void Want(Ref src, RefSpec spec) { ObjectId newId = src.GetObjectId(); if (spec.GetDestination() != null) { TrackingRefUpdate tru = CreateUpdate(spec, newId); if (newId.Equals(tru.GetOldObjectId())) { return; } localUpdates.AddItem(tru); } askFor.Put(newId, src); FetchHeadRecord fhr = new FetchHeadRecord(); fhr.newValue = newId; fhr.notForMerge = spec.GetDestination() != null; fhr.sourceName = src.GetName(); fhr.sourceURI = transport.GetURI(); fetchHeadUpdates.AddItem(fhr); }
/// <exception cref="NGit.Errors.TransportException"></exception> private void Want(Ref src, RefSpec spec) { ObjectId newId = src.GetObjectId(); if (spec.GetDestination() != null) { try { TrackingRefUpdate tru = CreateUpdate(spec, newId); if (newId.Equals(tru.GetOldObjectId())) { return; } localUpdates.AddItem(tru); } catch (IOException err) { // Bad symbolic ref? That is the most likely cause. // throw new TransportException(MessageFormat.Format(JGitText.Get().cannotResolveLocalTrackingRefForUpdating , spec.GetDestination()), err); } } askFor.Put(newId, src); FetchHeadRecord fhr = new FetchHeadRecord(); fhr.newValue = newId; fhr.notForMerge = spec.GetDestination() != null; fhr.sourceName = src.GetName(); fhr.sourceURI = transport.GetURI(); fetchHeadUpdates.AddItem(fhr); }