@@ -62,7 +62,6 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
62
62
Repository repo = instance .repositoryFor (project );
63
63
String path = repo .getWorkTree ().toPath ().relativize (file .toPath ()).toString ();
64
64
65
- System .out .print ("isClean " + path + " " );
66
65
// TODO: should be cached-per-repo if it is thread-safe, or per-repo-per-thread if it is not
67
66
DirCache dirCache = repo .readDirCache ();
68
67
@@ -75,7 +74,6 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
75
74
new IndexDiffFilter (INDEX , WORKDIR )));
76
75
77
76
if (!treeWalk .next ()) {
78
- System .out .println ("A yes" );
79
77
// the file we care about is git clean
80
78
return true ;
81
79
} else {
@@ -88,29 +86,24 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
88
86
89
87
if (!hasTree ) {
90
88
// it's not in the tree, so it was added
91
- System .out .println ("B no" );
92
89
return false ;
93
90
} else {
94
91
if (hasDirCache ) {
95
92
boolean treeEqualsIndex = treeIterator .idEqual (dirCacheIterator ) && treeIterator .getEntryRawMode () == dirCacheIterator .getEntryRawMode ();
96
93
boolean indexEqualsWC = !workingTreeIterator .isModified (dirCacheIterator .getDirCacheEntry (), true , treeWalk .getObjectReader ());
97
94
if (treeEqualsIndex != indexEqualsWC ) {
98
95
// if one is equal and the other isn't, then it has definitely changed
99
- System .out .println ("C no" );
100
96
return false ;
101
97
} else if (treeEqualsIndex ) {
102
- System .out .println ("D yes" ); // NEED
103
98
// this means they are all equal to each other, which should never happen
104
99
// the IndexDiffFilter should keep those out of the TreeWalk entirely
105
100
throw new IllegalStateException ("Index status for " + file + " against treeSha " + treeSha + " is invalid." );
106
101
} else {
107
102
// they are all unique
108
- System .out .print ("E " );
109
103
// we have to check manually
110
104
return worktreeIsCleanCheckout (treeWalk );
111
105
}
112
106
} else {
113
- System .out .print ("F " );
114
107
// no dirCache, so we will compare the tree to the workdir manually
115
108
return worktreeIsCleanCheckout (treeWalk );
116
109
}
@@ -121,9 +114,7 @@ public static boolean isClean(Project project, ObjectId treeSha, File file) thro
121
114
122
115
/** Returns true if the worktree file is a clean checkout of head (possibly smudged). */
123
116
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 );
127
118
}
128
119
129
120
private final static int TREE = 0 ;
@@ -202,7 +193,6 @@ public static ObjectId treeShaOf(Project project, String reference) {
202
193
}
203
194
instance .shaCache .put (repo , reference , treeSha );
204
195
}
205
- System .out .println ("treeSha of " + reference + " is " + treeSha );
206
196
return treeSha ;
207
197
} catch (Exception e ) {
208
198
throw Errors .asRuntime (e );
0 commit comments