private boolean match(SCM scm, URIish url) { if (scm instanceof GitSCM) { for (RemoteConfig remoteConfig : ((GitSCM) scm).getRepositories()) { for (URIish urIish : remoteConfig.getURIs()) { // needed cause the ssh and https URI differs in Bitbucket Server. if(urIish.getPath().startsWith("/scm")){ urIish = urIish.setPath(urIish.getPath().substring(4)); } LOGGER.log(Level.FINE, "Trying to match {0} ", urIish.toString() + "<-->" + url.toString()); if (GitStatus.looselyMatches(urIish, url)) { return true; } } } } else if (scm instanceof MercurialSCM) { try { URI hgUri = new URI(((MercurialSCM) scm).getSource()); String remote = url.toString(); if (looselyMatches(hgUri, remote)) { return true; } } catch (URISyntaxException ex) { LOGGER.log(Level.SEVERE, "Could not parse jobSource uri: {0} ", ex); } } return false; }
if (GitStatus.looselyMatches(u, remote)) { SCMHead head = new SCMHead(branch); for (SCMHeadPrefilter filter: ctx.prefilters()) {
URIish matchedURL = null; for (URIish remoteURL : repository.getURIs()) { if (looselyMatches(uri, remoteURL)) { repositoryMatches = true; matchedURL = remoteURL;
if (GitStatus.looselyMatches(uri, remoteURL)) { for (BranchSpec branchSpec : git.getBranches()) { if (branchSpec.getName().contains("$")) {
if (GitStatus.looselyMatches(uri, remoteURL)) { for (BranchSpec branchSpec : git.getBranches()) { if (branchSpec.getName().contains("$")) {
branchMatches = false; for (URIish remoteURL : repository.getURIs()) { if (looselyMatches(uri, remoteURL)) { repositoryMatches = true; break;
@Override public boolean isMatch(SCMSource source) { if (source instanceof GitSCMSource) { GitSCMSource git = (GitSCMSource) source; GitSCMSourceContext ctx = new GitSCMSourceContext<>(null, SCMHeadObserver.none()) .withTraits(git.getTraits()); if (ctx.ignoreOnPushNotifications()) { return false; } URIish remote; try { remote = new URIish(git.getRemote()); } catch (URISyntaxException e) { // ignore return false; } if (GitStatus.looselyMatches(u, remote)) { notified[0] = true; return true; } return false; } return false; }
if (GitStatus.looselyMatches(uri, remote)) { LOGGER.info("Triggering the indexing of " + owner.getFullDisplayName() + " as a result of event from " + origin);