Skip to content

Commit 2402c12

Browse files
author
Vaidas Lažauskas
committed
Fix for username same as repository name
Add more debug information to logs
1 parent dc580a7 commit 2402c12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ private static List<BitbucketBuildStatusResource> createBuildStatusResources(fin
104104
);
105105

106106
if (repoName.isEmpty()) {
107-
logger.log(Level.INFO, "Bitbucket build notifier could not extract the repository name from the repository URL");
107+
logger.log(Level.INFO, "Bitbucket build notifier could not extract the repository name from the repository URL: " + repoUrl);
108108
continue;
109109
}
110110

111-
String userName = repoUrl.substring(0, repoUrl.indexOf("/" + repoName));
111+
String userName = repoUrl.substring(0, repoUrl.lastIndexOf("/" + repoName));
112112
if (userName.contains("/")) {
113113
userName = userName.substring(userName.indexOf("/") + 1, userName.length());
114114
}
115115
if (userName.isEmpty()) {
116-
logger.log(Level.INFO, "Bitbucket build notifier could not extract the user name from the repository URL");
116+
logger.log(Level.INFO, "Bitbucket build notifier could not extract the user name from the repository URL: " + repoUrl + " with repository name: " + repoName);
117117
continue;
118118
}
119119

0 commit comments

Comments
 (0)