WorkingTree workTree = workingTree();
StagingArea index = index();
StatusSummary summary = new StatusSummary();
summary.countStaged = index.countStaged(null).count();
summary.countUnstaged = workTree.countUnstaged(null).count();
summary.countConflicted = index.countConflicted(null);
if (summary.countStaged > 0) {
summary.staged = command(DiffIndex.class).setReportTrees(true);