Only resort a tree's contents when required.
commit58876ab5d1e79a48e6be8e41736d23b4309c2867
authorShawn O. Pearce <spearce@spearce.org>
Mon, 7 Aug 2006 06:17:48 +0000 (7 02:17 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 7 Aug 2006 06:17:48 +0000 (7 02:17 -0400)
tree7833881f2c677cc757baca615262e533b21090e8
parent0057bd6a1d80e85bdc01c71a491bc78d7afc417c
Only resort a tree's contents when required.

Since most trees contain files and no subtrees most trees will
always be sorted 'correctly' for both our in memory format and the
external GIT format.  Since attempting to resort an already sorted
list will not run very quickly when compared to not resorting the
list at all we try to detect if a Tree is present in the current
tree's contents and only resort if one (or more) is found.  If no
Trees are present then no sorting is necessary.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.spearce.jgit/src/org/spearce/jgit/lib/ObjectWriter.java
org.spearce.jgit/src/org/spearce/jgit/lib/Tree.java