diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2017-02-07 00:22:57 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-02-07 00:24:39 +0100 |
commit | f8d232213cb502214dc7d490b1bc612f88f0635f (patch) | |
tree | 18a163c99d625d5b9a788f9f6dd540de90a967c3 /org.eclipse.jgit.test/tst | |
parent | d4bd09b78daa733933a15733bc6ebbaa0a0485f1 (diff) | |
download | jgit-f8d232213cb502214dc7d490b1bc612f88f0635f.tar.gz jgit-f8d232213cb502214dc7d490b1bc612f88f0635f.zip |
Branch normalizer should not normalize already valid branch names
Change-Id: Ib746655e32a37c4ad323f1d12ac0817de8fa56cf
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java index 9c85fbe1ea..f069b65f66 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ValidRefNameTest.java @@ -329,4 +329,18 @@ public class ValidRefNameTest { Repository.normalizeBranchName("Bug 1#$ 2345 - Hello World") .equals("Bug_12345-Hello_World")); } + + @Test + public void testNormalizeAlreadyValidRefName() { + assertEquals(true, + Repository.normalizeBranchName("refs/heads/m.a.s.t.e.r") + .equals("refs/heads/m.a.s.t.e.r")); + } + + @Test + public void testNormalizeTrimmedUnicodeAlreadyValidRefName() { + assertEquals(true, + Repository.normalizeBranchName(" \u00e5ngstr\u00f6m\t") + .equals("\u00e5ngstr\u00f6m")); + } } |