Skip to content

Commit

Permalink
jgit/ clean status check should ignore any 'untracked folders' (apach…
Browse files Browse the repository at this point in the history
…e#13728)

* Ignore any 'untracked folders' apache#13719
* Upgrade jgit to 6.10.0.202406032230-r.
  • Loading branch information
dweiss authored Sep 6, 2024
1 parent 5f242b3 commit d7dc57d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions gradle/validation/git-status.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d7dc57d

Please sign in to comment.