@Override protected StatusSummary _call() { WorkingTree workTree = workingTree(); StagingArea index = stagingArea(); StatusSummary summary = new StatusSummary(); summary.countStaged = index.countStaged(null).count(); summary.countUnstaged = workTree.countUnstaged(null).count(); summary.countConflicted = index.countConflicted(null); final Long limit = this.limit == null ? null : this.limit; if (limit == null || limit.longValue() > 0) { if (summary.countStaged > 0) { summary.staged = command(DiffIndex.class).setMaxDiffs(limit).setReportTrees(true); } if (summary.countUnstaged > 0) { summary.unstaged = command(DiffWorkTree.class).setMaxDiffs(limit) .setReportTrees(true); } if (summary.countConflicted > 0) { summary.conflicts = command(ConflictsQueryOp.class); } } return summary; }
@Override protected StatusSummary _call() { WorkingTree workTree = workingTree(); StagingArea index = stagingArea(); StatusSummary summary = new StatusSummary(); summary.countStaged = index.countStaged(null).count(); summary.countUnstaged = workTree.countUnstaged(null).count(); summary.countConflicted = index.countConflicted(null); final Long limit = this.limit == null ? null : this.limit; if (limit == null || limit.longValue() > 0) { if (summary.countStaged > 0) { summary.staged = command(DiffIndex.class).setMaxDiffs(limit).setReportTrees(true); } if (summary.countUnstaged > 0) { summary.unstaged = command(DiffWorkTree.class).setMaxDiffs(limit) .setReportTrees(true); } if (summary.countConflicted > 0) { summary.conflicts = command(ConflictsQueryOp.class); } } return summary; }
final long numChanges = workingTree().countUnstaged(pathFilter).count();
final long numChanges = workingTree().countUnstaged(pathFilter).count();
assertEquals(20, count.featureCount()); assertEquals(0, count.treeCount()); assertEquals(20, count.count()); assertEquals(30, count.featureCount()); assertEquals(0, count.treeCount()); assertEquals(30, count.count()); assertEquals(45, count.featureCount()); assertEquals(0, count.treeCount()); assertEquals(45, count.count()); assertEquals(60, count.featureCount()); assertEquals(0, count.treeCount()); assertEquals(60, count.count()); assertEquals(65, count.featureCount()); assertEquals(0, count.treeCount()); assertEquals(65, count.count()); assertEquals(70, count.featureCount()); assertEquals(0, count.treeCount()); assertEquals(70, count.count()); assertEquals(70, count.featureCount()); assertEquals(10, count.treeCount()); assertEquals(80, count.count()); assertEquals(70, count.featureCount());
@Test public void testConstructorAndAccessors() { DiffObjectCount count = new DiffObjectCount(); assertEquals(0, count.getFeaturesAdded()); assertEquals(0, count.getFeaturesChanged()); assertEquals(0, count.getFeaturesRemoved()); assertEquals(0, count.getTreesAdded()); assertEquals(0, count.getTreesChanged()); assertEquals(0, count.getTreesRemoved()); assertEquals(0, count.featureCount()); assertEquals(0, count.treeCount()); assertEquals(0, count.count()); }