jgit/ clean status check should ignore any 'untracked folders' (#13728)

* Ignore any 'untracked folders' #13719
* Upgrade jgit to 6.10.0.202406032230-r.
This commit is contained in:
Dawid Weiss 2024-09-06 09:01:15 +02:00 committed by GitHub
parent 5f242b3b26
commit d7dc57dd0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 18 deletions

View File

@ -74,21 +74,6 @@ configure(rootProject) {
logger.warn("WARNING: Directory is not a valid git checkout (won't check dirty files): ${rootProject.projectDir}")
}
} else {
// git ignores any folders which are empty (this includes folders with recursively empty sub-folders).
def untrackedNonEmptyFolders = status.untrackedFolders.findAll { path ->
File location = file("${rootProject.projectDir}/${path}")
boolean hasFiles = false
Files.walkFileTree(location.toPath(), new SimpleFileVisitor<Path>() {
@Override
FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
hasFiles = true
// Terminate early.
return FileVisitResult.TERMINATE
}
})
return hasFiles
}
def offenders = [
// Exclude staged changes. These are fine in precommit.
// "(added)": status.added,
@ -97,8 +82,7 @@ configure(rootProject) {
"(conflicting)": status.conflicting,
"(missing)": status.missing,
"(modified)": status.modified,
"(untracked)": status.untracked,
"(untracked non-empty dir)": untrackedNonEmptyFolders
"(untracked)": status.untracked
].collectMany { fileStatus, files ->
files.collect {file -> " - ${file} ${fileStatus}" }
}.sort()

View File

@ -14,7 +14,7 @@ hamcrest = "2.2"
icu4j = "74.2"
javacc = "7.0.12"
jflex = "1.8.2"
jgit = "5.13.1.202206130422-r"
jgit = "6.10.0.202406032230-r"
jmh = "1.37"
jts = "1.17.0"
junit = "4.13.1"