@Override public boolean apply(Ref r) { return Ref.isChild(remotePrefix, r.getName()); }};
public Optional<String> mapToRemote(final String local) { Preconditions.checkNotNull(local); String remoteRef = null; if (isAllChildren()) { if (Ref.isChild(this.localRef, local)) { final String localRefName = local.substring(this.localRef.length()); remoteRef = Ref.append(this.remoteRef, localRefName); } } else { if (local.equals(this.localRef)) { remoteRef = this.remoteRef; } } return Optional.ofNullable(remoteRef); }
public Optional<String> mapToLocal(final String remoteRef) { Preconditions.checkNotNull(remoteRef); String localRef = null; if (isAllChildren()) { if (Ref.isChild(this.remoteRef, remoteRef)) { final String remoteRefName = remoteRef.substring(this.remoteRef.length()); localRef = Ref.append(this.localRef, remoteRefName); } } else { if (remoteRef.equals(this.remoteRef)) { localRef = this.localRef; } } return Optional.ofNullable(localRef); }
protected Ref _call() { checkState(branchName != null, "branch name was not provided"); final String branchRefPath; if (Ref.isChild(Ref.HEADS_PREFIX, branchName)) { branchRefPath = branchName; } else {