Skip to content

Commit

Permalink
Add test cyrillic file names from JENKINS-27910
Browse files Browse the repository at this point in the history
This does not address the core java library refusal to delete files
named with unmappable characters. That needs a different solution, and
a solution which would be better done in Jenkins core than in the git
client plugin.
  • Loading branch information
MarkEWaite committed Apr 24, 2015
1 parent a343f34 commit f690073
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
Expand Up @@ -722,6 +722,19 @@ public void test_clean() throws Exception {
w.git.add(fileName);
w.git.commit(fileName);

/* JENKINS-27910 reported that certain cyrillic file names
* failed to delete if the encoding was not UTF-8.
*/
String fileNameSwim = "\u00d0\u00bf\u00d0\u00bb\u00d0\u00b0\u00d0\u00b2\u00d0\u00b0\u00d0\u00bd\u00d0\u00b8\u00d0\u00b5-swim.png";
w.touch(fileNameSwim, "content " + fileNameSwim);
w.git.add(fileNameSwim);
w.git.commit(fileNameSwim);

String fileNameFace = "\u00d0\u00bb\u00d0\u00b8\u00d1\u2020\u00d0\u00be-face.png";
w.touch(fileNameFace, "content " + fileNameFace);
w.git.add(fileNameFace);
w.git.commit(fileNameFace);

w.touch(".gitignore", ".test");
w.git.add(".gitignore");
w.git.commit("ignore");
Expand All @@ -739,6 +752,8 @@ public void test_clean() throws Exception {
assertFalse(w.exists(fileName1));
assertFalse(w.exists(fileName2));
assertEquals("content " + fileName, w.contentOf(fileName));
assertEquals("content " + fileNameFace, w.contentOf(fileNameFace));
assertEquals("content " + fileNameSwim, w.contentOf(fileNameSwim));
String status = w.cmd("git status");
assertTrue("unexpected status " + status, status.contains("working directory clean"));

Expand Down

0 comments on commit f690073

Please sign in to comment.