diff options
author | Constantine Plotnikov <constantine.plotnikov@gmail.com> | 2009-10-08 20:12:08 +0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2009-10-08 10:19:34 -0700 |
commit | 982515cf10dfbdfb9b40cb3582dfc54e2855a79d (patch) | |
tree | 854e7278126579401fba9b7bca55e7e3fc0046a4 /org.eclipse.jgit.test | |
parent | aa08a022f14f14d8d9a458a7ec6bee7b3af693d2 (diff) | |
download | jgit-982515cf10dfbdfb9b40cb3582dfc54e2855a79d.tar.gz jgit-982515cf10dfbdfb9b40cb3582dfc54e2855a79d.zip |
Make the default encoding when reading commits UTF-8
When reading commits the system default encoding was used if no
encoding was specified in the commit. The patch modifies the test
to add a check that commit message was encoded correctly (the
test fails on old implementation if system encoding is not UTF-8)
and fixes Commit.decode() method to use UTF-8 if encoding is not
specified in the commit object.
Change-Id: I27101da3c2eb6edd0c4a9e4c0523e48b286e3cd5
Signed-off-by: Constantine Plotnikov <constantine.plotnikov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java index 081e8e4c9d..2cf557fb01 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java @@ -344,6 +344,9 @@ public class T0003_Basic extends RepositoryTestCase { commit.setMessage("\u00dcbergeeks"); ObjectId cid = new ObjectWriter(db).writeCommit(commit); assertEquals("4680908112778718f37e686cbebcc912730b3154", cid.name()); + Commit loadedCommit = db.mapCommit(cid); + assertNotSame(loadedCommit, commit); + assertEquals(commit.getMessage(), loadedCommit.getMessage()); } public void test024_createCommitNonAscii() throws IOException { |