Skip to content

Commit eac82d2

Browse files
committed
Remove the logging we used to show that the test was exhaustive (wish we could do code-coverage on all tests, including testkit integration tests)
1 parent 87e466f commit eac82d2

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

plugin-gradle/src/main/java/com/diffplug/gradle/spotless/GitRatchet.java

+1-11
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
6262
Repository repo = instance.repositoryFor(project);
6363
String path = repo.getWorkTree().toPath().relativize(file.toPath()).toString();
6464

65-
System.out.print("isClean " + path + " ");
6665
// TODO: should be cached-per-repo if it is thread-safe, or per-repo-per-thread if it is not
6766
DirCache dirCache = repo.readDirCache();
6867

@@ -75,7 +74,6 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
7574
new IndexDiffFilter(INDEX, WORKDIR)));
7675

7776
if (!treeWalk.next()) {
78-
System.out.println("A yes");
7977
// the file we care about is git clean
8078
return true;
8179
} else {
@@ -88,29 +86,24 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
8886

8987
if (!hasTree) {
9088
// it's not in the tree, so it was added
91-
System.out.println("B no");
9289
return false;
9390
} else {
9491
if (hasDirCache) {
9592
boolean treeEqualsIndex = treeIterator.idEqual(dirCacheIterator) && treeIterator.getEntryRawMode() == dirCacheIterator.getEntryRawMode();
9693
boolean indexEqualsWC = !workingTreeIterator.isModified(dirCacheIterator.getDirCacheEntry(), true, treeWalk.getObjectReader());
9794
if (treeEqualsIndex != indexEqualsWC) {
9895
// if one is equal and the other isn't, then it has definitely changed
99-
System.out.println("C no");
10096
return false;
10197
} else if (treeEqualsIndex) {
102-
System.out.println("D yes"); // NEED
10398
// this means they are all equal to each other, which should never happen
10499
// the IndexDiffFilter should keep those out of the TreeWalk entirely
105100
throw new IllegalStateException("Index status for " + file + " against treeSha " + treeSha + " is invalid.");
106101
} else {
107102
// they are all unique
108-
System.out.print("E ");
109103
// we have to check manually
110104
return worktreeIsCleanCheckout(treeWalk);
111105
}
112106
} else {
113-
System.out.print("F ");
114107
// no dirCache, so we will compare the tree to the workdir manually
115108
return worktreeIsCleanCheckout(treeWalk);
116109
}
@@ -121,9 +114,7 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
121114

122115
/** Returns true if the worktree file is a clean checkout of head (possibly smudged). */
123116
private static boolean worktreeIsCleanCheckout(TreeWalk treeWalk) {
124-
boolean result = treeWalk.idEqual(TREE, WORKDIR);
125-
System.out.println(result ? "yes" : "no");
126-
return result;
117+
return treeWalk.idEqual(TREE, WORKDIR);
127118
}
128119

129120
private final static int TREE = 0;
@@ -202,7 +193,6 @@ public static ObjectId treeShaOf(Project project, String reference) {
202193
}
203194
instance.shaCache.put(repo, reference, treeSha);
204195
}
205-
System.out.println("treeSha of " + reference + " is " + treeSha);
206196
return treeSha;
207197
} catch (Exception e) {
208198
throw Errors.asRuntime(e);

testlib/src/main/java/com/diffplug/spotless/ResourceHarness.java

-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ public File toLines(String... lines) throws IOException {
222222
}
223223

224224
public File toContent(String content) throws IOException {
225-
System.out.print("toContent(" + content + ") ");
226225
return toContent(content, StandardCharsets.UTF_8);
227226
}
228227

0 commit comments

Comments
 (0)