Defined some utility routines to create PersonIdents and Commits.
commit8dbf6b4f9eb565fa8ac9fb32ecf3b29e0b90eab5
authorShawn O. Pearce <spearce@spearce.org>
Mon, 31 Jul 2006 06:15:05 +0000 (31 02:15 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 31 Jul 2006 06:15:05 +0000 (31 02:15 -0400)
treeef981caef3c6de6aea1dea20b21f2f88293d3a68
parentdd15fb4c0eaed406875e927e93b7b75b2bd75c00
Defined some utility routines to create PersonIdents and Commits.

When testing its useful to be able to supply the PersonIdent
timestamp data in a more raw format so there are now constructors
for PersonIdent that will accept the 'parsed' format more readily.

Added hashCode and equals implementations to PersonIdent so that
two PersonIdents which are logically equivilent (same name, email
and time but ignore time zone) will actually be considered to be
equal to one another by most Java functions.

Added utility function commit() to the Commit class, making it
easier to construct a one-off commit.  Its faster to recycle an
existing ObjectWriter (as the compressor and message digest objects
are reused) but that's not always convenient to do in unit tests.

When setting a tree on a Commit don't null out the treeId; instead
set it to the id of the tree, if it has one.  If it doesn't have
one yet then it will still get set to null.

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/PersonIdent.java