/** * Does this specification's source description match the ref name? * * @param r * ref name that should be tested. * @return true if the names match; false otherwise. */ public boolean matchSource(String r) { return match(r, getSource()); }
/** * Does this specification's source description match the ref? * * @param r * ref whose name should be tested. * @return true if the names match; false otherwise. */ public boolean matchSource(Ref r) { return match(r.getName(), getSource()); }
private RefSpec(RefSpec p) { force = p.isForceUpdate(); wildcard = p.isWildcard(); srcName = p.getSource(); dstName = p.getDestination(); allowMismatchedWildcards = p.allowMismatchedWildcards; }
private void deleteStaleTrackingRefs(FetchResult result, BatchRefUpdate batch) throws IOException { Set<Ref> processed = new HashSet<>(); for (Ref ref : localRefs().values()) { if (ref.isSymbolic()) { continue; } String refname = ref.getName(); for (RefSpec spec : toFetch) { if (spec.matchDestination(refname)) { RefSpec s = spec.expandFromDestination(refname); if (result.getAdvertisedRef(s.getSource()) == null && processed.add(ref)) { deleteTrackingRef(result, batch, s, ref); } } } } }
/** {@inheritDoc} */ @Override public boolean equals(Object obj) { if (!(obj instanceof RefSpec)) return false; final RefSpec b = (RefSpec) obj; if (isForceUpdate() != b.isForceUpdate()) return false; if (isWildcard() != b.isWildcard()) return false; if (!eq(getSource(), b.getSource())) return false; if (!eq(getDestination(), b.getDestination())) return false; return true; }
private void expandSingle(RefSpec spec, Set<Ref> matched) throws TransportException { String want = spec.getSource(); if (ObjectId.isId(want)) { want(ObjectId.fromString(want)); return; } Ref src = conn.getRef(want); if (src == null) { throw new TransportException(MessageFormat.format(JGitText.get().remoteDoesNotHaveSpec, want)); } if (matched.add(src)) { want(src, spec); } }
String srcSpec = spec.getSource(); final Ref srcRef = db.findRef(srcSpec); if (srcRef != null)
private TrackingRefUpdate createUpdate(RefSpec spec, ObjectId newId) throws TransportException { Ref ref = localRefs().get(spec.getDestination()); ObjectId oldId = ref != null && ref.getObjectId() != null ? ref.getObjectId() : ObjectId.zeroId(); return new TrackingRefUpdate( spec.isForceUpdate(), spec.getSource(), spec.getDestination(), oldId, newId); }
private void deleteTrackingRef(final FetchResult result, final BatchRefUpdate batch, final RefSpec spec, final Ref localRef) { if (localRef.getObjectId() == null) return; TrackingRefUpdate update = new TrackingRefUpdate( true, spec.getSource(), localRef.getName(), localRef.getObjectId(), ObjectId.zeroId()); result.add(update); batch.addCommand(update.asReceiveCommand()); }
final Set<Ref> matched = new HashSet<>(); for (RefSpec spec : toFetch) { if (spec.getSource() == null) throw new TransportException(MessageFormat.format( JGitText.get().sourceRefNotSpecifiedForRefspec, spec));
/** * Does this specification's source description match the ref name? * * @param r * ref name that should be tested. * @return true if the names match; false otherwise. */ public boolean matchSource(String r) { return match(r, getSource()); }
GitLabSCMRefSpec(RefSpec refSpec) { this.delegate = refSpec; this.sourceNamePattern = Pattern.compile(replaceWildcard(delegate.getSource(), "(.*)")); }
/** * Does this specification's source description match the ref name? * * @param r * ref name that should be tested. * @return true if the names match; false otherwise. */ public boolean matchSource(final String r) { return match(r, getSource()); }
private void expandSingle(final RefSpec spec, final Set<Ref> matched) throws TransportException { final Ref src = conn.getRef(spec.getSource()); if (src == null) { throw new TransportException(MessageFormat.format(JGitText.get().remoteDoesNotHaveSpec, spec.getSource())); } if (matched.add(src)) want(src, spec); }
private RefSpec(final RefSpec p) { force = p.isForceUpdate(); wildcard = p.isWildcard(); srcName = p.getSource(); dstName = p.getDestination(); allowMismatchedWildcards = p.allowMismatchedWildcards; }
private TrackingRefUpdate createUpdate(RefSpec spec, ObjectId newId) throws TransportException { Ref ref = localRefs().get(spec.getDestination()); ObjectId oldId = ref != null && ref.getObjectId() != null ? ref.getObjectId() : ObjectId.zeroId(); return new TrackingRefUpdate( spec.isForceUpdate(), spec.getSource(), spec.getDestination(), oldId, newId); }