Skip to content

Commit 3ef3287

Browse files
committed
crlf: log warning when detected an inaccessible file/directory
1 parent 91db45d commit 3ef3287

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/crlf-plugin/src/main/kotlin/com/github/vlsi/gradle/git/GitIgnoreFilter.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import org.eclipse.jgit.treewalk.TreeWalk
2929
import org.gradle.api.file.FileTreeElement
3030
import org.gradle.api.file.RelativePath
3131
import org.gradle.api.specs.Spec
32+
import org.slf4j.LoggerFactory
3233
import java.io.File
3334
import java.lang.UnsupportedOperationException
3435
import java.nio.file.Path
@@ -92,6 +93,9 @@ class DirectorySet<E> {
9293
}
9394

9495
abstract class GitHolder<T, V>(rootPath: Path) {
96+
companion object {
97+
val log = LoggerFactory.getLogger(GitHolder::class.java)
98+
}
9599
private val rootDir = rootPath.toFile()
96100
private val rootAbsolutePath = rootDir.canonicalPath
97101

@@ -125,6 +129,7 @@ abstract class GitHolder<T, V>(rootPath: Path) {
125129
element.isDirectory
126130
} catch (e: UnsupportedOperationException) {
127131
// If the element is not accessible, assume it is a directory
132+
log.warn("File ${element.file} is not accessible, so can't tell if it should be ingored or not with .gitignore filters")
128133
true
129134
}
130135
)

0 commit comments

Comments
 (0)