Support commit encoding header
commit3c847c81d9cf8cf11aa1dfd9e4c9c6d0020c87d7
authorShawn O. Pearce <spearce@spearce.org>
Mon, 12 Mar 2007 19:57:23 +0000 (12 15:57 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 12 Mar 2007 20:47:59 +0000 (12 16:47 -0400)
treeea1a91c705b4b2e5d460cd1e4e311dc2917d3271
parent2ec6c3333c8d6fe7f09d66d922d8b224ad50bb25
Support commit encoding header

Commit objects may contain an encoding, supposedly meant to
indicated the encoding used for that particular commt.

This is the last header line before the comment as far as I know.

Unfortunately the encoding header only reflects a setting in the
config file, so it is most likely to be wrong by default unless
you are on a UTF-8 platform (in which case the header isn't really
needed). Later on we'll have to decode that more intelligently. For
now we make an attempt to decode according to the setting if present,
otherwise we use the platform default.

[sp: Changed String constructor to a version that is supported
 on Java 5.  Modified unit tests to be stable across systems.
 For unknown reasons these were coming up with different time
 values and timestamps on my system vs. Robin's.]

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/lib/Commit.java
org.spearce.jgit/src/org/spearce/jgit/lib/ObjectWriter.java
org.spearce.jgit/tst/org/spearce/jgit/lib/T0003_Basic.java