Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Jongman2017-01-19 09:19:21 +0000
committerMatthias Sohn2017-01-19 22:54:23 +0000
commitaebf9835047ce08422912e5d05e69fd97a10ac81 (patch)
tree30e594c474ee9234d6e311e3ca9b3f49babaf0c8 /org.eclipse.egit.mylyn.ui/src/org
parentc29675091c19aa88365033ed7cb7608020efac97 (diff)
downloadegit-aebf9835047ce08422912e5d05e69fd97a10ac81.tar.gz
egit-aebf9835047ce08422912e5d05e69fd97a10ac81.tar.xz
egit-aebf9835047ce08422912e5d05e69fd97a10ac81.zip
Use the JGit API for branch name normalization.
JGit contains a method to normalize the branch name. Normalization is delegated to that method Bug: 509878 Change-Id: I92a29d7af2addc134c47ac12d68c01e42c66d76e Signed-off-by: Wim Jongman <wim.jongman@remainsoftware.com>
Diffstat (limited to 'org.eclipse.egit.mylyn.ui/src/org')
-rw-r--r--org.eclipse.egit.mylyn.ui/src/org/eclipse/egit/internal/mylyn/ui/commit/ActiveTaskBranchNameProvider.java5
1 files changed, 2 insertions, 3 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 6ec42ea0d9..0a2b6412e6 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
@@ -15,6 +15,7 @@
package org.eclipse.egit.internal.mylyn.ui.commit;
import org.eclipse.egit.ui.IBranchNameProvider;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -52,12 +53,10 @@ public class ActiveTaskBranchNameProvider implements IBranchNameProvider {
}
private String normalizeBranchName(String name) {
- String normalized = name.trim()
- .replaceAll("\\s+", "_").replaceAll("[^\\w-]", ""); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ String normalized = Repository.normalizeBranchName(name);
if (normalized.length() > 30)
normalized = normalized.substring(0, 30);
return normalized;
}
-
}

Back to the top