NotificationEmail: Fix eliding project name without slash
When a project name does not contain a slash, the name should not be elided with "...". Add extra tests that would have caught this. Bug: Issue 10896 Change-Id: I131fa5c5016e758e8c6d7d2b09625fae6593da7b
This commit is contained in:
@@ -132,6 +132,9 @@ public abstract class NotificationEmail extends OutgoingEmail {
|
||||
if (lastIndexSlash == 0) {
|
||||
return projectName.substring(1); // Remove the first slash
|
||||
}
|
||||
if (lastIndexSlash == -1) { // No slash in the project name
|
||||
return projectName;
|
||||
}
|
||||
|
||||
return "..." + projectName.substring(lastIndexSlash + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user