Patch Set 1: Looks good to me, but someone else must approve

mapTree() is still used by EGit (org.eclipse.egit.core.op.CommitOperation.prepareTrees(IFile[], HashMap<Repository, Tree>, IProgressMonitor)) so I'll wait a bit on this...