Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2017-03-03 12:23:05 +0000
committerThomas Wolf2017-03-03 12:54:48 +0000
commitac31bf4aa161b75544bafb760790c865fed9b2c5 (patch)
treeb5a7acfb7b93a163b50cafc88e00e5d897d97316 /org.eclipse.egit.mylyn.ui
parent4bc15e7f9023024b9e1c803d185ed16730218931 (diff)
downloadegit-ac31bf4aa161b75544bafb760790c865fed9b2c5.tar.gz
egit-ac31bf4aa161b75544bafb760790c865fed9b2c5.tar.xz
egit-ac31bf4aa161b75544bafb760790c865fed9b2c5.zip
Repository.normalizeBranchName can return null
Add null checks. Also normalize again in egit.mylyn if we cut after 30 characters: if we're unlucky, the substring might end with a slash or a period, and JGit likes neither. Change-Id: I50057382e403d6906db2cc6add24d0ac7a32c207 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.mylyn.ui')
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/ActiveTaskBranchNameProvider.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/ActiveTaskBranchNameProvider.java b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/ActiveTaskBranchNameProvider.java
index 0a2b6412e6..8c06b6d730 100644
--- a/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/ActiveTaskBranchNameProvider.java
+++ b/org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/ActiveTaskBranchNameProvider.java
@@ -54,8 +54,10 @@ public class ActiveTaskBranchNameProvider implements IBranchNameProvider {
private String normalizeBranchName(String name) {
String normalized = Repository.normalizeBranchName(name);
- if (normalized.length() > 30)
- normalized = normalized.substring(0, 30);
+ if (normalized != null && normalized.length() > 30) {
+ normalized = Repository
+ .normalizeBranchName(normalized.substring(0, 30));
+ }
return normalized;
}
}

Back to the top