mirror of https://github.com/apache/lucene.git
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:
parent
5f242b3b26
commit
d7dc57dd0d
|
@ -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()
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue