in git-server/src/main/java/jetbrains/buildServer/buildTriggers/vcs/git/patch/GitPatchBuilder.java [120:150]
private void walkTree() throws Exception {
while (myTreeWalk.next()) {
String path = myTreeWalk.getPathString();
String mappedPath = myRules.map(path);
if (mappedPath == null) {
myLogger.logFileExcludedByCheckoutRules(path, myRules);
continue;
}
if (myLogger.isDebugEnabled()) {
myLogger.logVisitFile(myTreeWalk.treeWalkInfo(path));
}
ChangeType changeType = myTreeWalk.classifyChange();
myLogger.logChangeType(path, changeType);
switch (changeType) {
case UNCHANGED:
break;
case MODIFIED:
case ADDED:
case FILE_MODE_CHANGED:
if (!FileMode.GITLINK.equals(myTreeWalk.getFileMode(0)))
changeOrCreateFile(path, mappedPath);
break;
case DELETED:
if (!FileMode.GITLINK.equals(myTreeWalk.getFileMode(0)))
deleteFile(mappedPath);
break;
default:
throw new IllegalStateException("Unknown change type");
}
}
}