Skip to content

Commit d7dc57d

Browse files
authored
jgit/ clean status check should ignore any 'untracked folders' (apache#13728)
* Ignore any 'untracked folders' apache#13719 * Upgrade jgit to 6.10.0.202406032230-r.
1 parent 5f242b3 commit d7dc57d

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

gradle/validation/git-status.gradle

+1-17
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,6 @@ configure(rootProject) {
7474
logger.warn("WARNING: Directory is not a valid git checkout (won't check dirty files): ${rootProject.projectDir}")
7575
}
7676
} else {
77-
// git ignores any folders which are empty (this includes folders with recursively empty sub-folders).
78-
def untrackedNonEmptyFolders = status.untrackedFolders.findAll { path ->
79-
File location = file("${rootProject.projectDir}/${path}")
80-
boolean hasFiles = false
81-
Files.walkFileTree(location.toPath(), new SimpleFileVisitor<Path>() {
82-
@Override
83-
FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
84-
hasFiles = true
85-
// Terminate early.
86-
return FileVisitResult.TERMINATE
87-
}
88-
})
89-
return hasFiles
90-
}
91-
9277
def offenders = [
9378
// Exclude staged changes. These are fine in precommit.
9479
// "(added)": status.added,
@@ -97,8 +82,7 @@ configure(rootProject) {
9782
"(conflicting)": status.conflicting,
9883
"(missing)": status.missing,
9984
"(modified)": status.modified,
100-
"(untracked)": status.untracked,
101-
"(untracked non-empty dir)": untrackedNonEmptyFolders
85+
"(untracked)": status.untracked
10286
].collectMany { fileStatus, files ->
10387
files.collect {file -> " - ${file} ${fileStatus}" }
10488
}.sort()

versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ hamcrest = "2.2"
1414
icu4j = "74.2"
1515
javacc = "7.0.12"
1616
jflex = "1.8.2"
17-
jgit = "5.13.1.202206130422-r"
17+
jgit = "6.10.0.202406032230-r"
1818
jmh = "1.37"
1919
jts = "1.17.0"
2020
junit = "4.13.1"

0 commit comments

Comments
 (0)