diff options
author | James Moger <james.moger@gitblit.com> | 2012-02-23 17:06:46 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-02-23 17:06:46 -0500 |
commit | e5cb554318f2be8c288789e47f80beb242f3cea6 (patch) | |
tree | 39e1c1ca67f8e5de4745d182ef256bd6d723182f /tests/com | |
parent | 7a1889b343b24aa18ce9440794606f4c08c2741f (diff) | |
download | gitblit-e5cb554318f2be8c288789e47f80beb242f3cea6.tar.gz gitblit-e5cb554318f2be8c288789e47f80beb242f3cea6.zip |
Fixed UTF-8 encoding bug in diff formatter (issue 66)
Diffstat (limited to 'tests/com')
-rw-r--r-- | tests/com/gitblit/tests/GitServletTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/com/gitblit/tests/GitServletTest.java b/tests/com/gitblit/tests/GitServletTest.java index 38d7fa9f..2f9a9c42 100644 --- a/tests/com/gitblit/tests/GitServletTest.java +++ b/tests/com/gitblit/tests/GitServletTest.java @@ -13,6 +13,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.jgit.api.CloneCommand;
import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
import org.eclipse.jgit.util.FileUtils;
import org.junit.AfterClass;
@@ -113,9 +114,9 @@ public class GitServletTest { public void testAnonymousPush() throws Exception {
Git git = Git.open(ticgitFolder);
File file = new File(ticgitFolder, "TODO");
- OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true));
+ OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true), Constants.CHARSET);
BufferedWriter w = new BufferedWriter(os);
- w.write("// " + new Date().toString() + "\n");
+ w.write("// hellol中文 " + new Date().toString() + "\n");
w.close();
git.add().addFilepattern(file.getName()).call();
git.commit().setMessage("test commit").call();
@@ -136,7 +137,7 @@ public class GitServletTest { Git git = Git.open(jgitFolder);
File file = new File(jgitFolder, "TODO");
- OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true));
+ OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true), Constants.CHARSET);
BufferedWriter w = new BufferedWriter(os);
w.write("// " + new Date().toString() + "\n");
w.close();
@@ -159,7 +160,7 @@ public class GitServletTest { Git git = Git.open(jgit2Folder);
File file = new File(jgit2Folder, "NONBARE");
- OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true));
+ OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(file, true), Constants.CHARSET);
BufferedWriter w = new BufferedWriter(os);
w.write("// " + new Date().toString() + "\n");
w.close();
|