Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Changes
* Bump default `ktlint` version to latest `1.7.1` -> `1.8.0`. ([2763](https://github.com/diffplug/spotless/pull/2763))
* Bump default `gherkin-utils` version to latest `9.2.0` -> `10.0.0`. ([#2619](https://github.com/diffplug/spotless/pull/2619))
- Fix null pointer exception when git ignored files are checked in ([911](https://github.com/diffplug/spotless/issues/911))

## [4.1.0] - 2025-11-18
### Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,14 @@ public boolean isClean(Project project, ObjectId treeSha, String relativePathUni
WorkingTreeIterator workingTreeIterator = treeWalk.getTree(WORKDIR, WorkingTreeIterator.class);

boolean hasTree = treeIterator != null;
Copy link
Contributor

@Pankraz76 Pankraz76 Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
boolean hasTree = treeIterator != null;
boolean hasTree = treeIterator != null && workingTreeIterator != null;

would also do the trick, calling the else case.

Ned should make the the call on this. Im just pointing out ideas. Thanks.

boolean hasWorkingTree = workingTreeIterator != null;
boolean hasDirCache = dirCacheIterator != null;

if (!hasWorkingTree) {
// Null check for issue 911
return true;
}

if (!hasTree) {
// it's not in the tree, so it was added
return false;
Expand Down
1 change: 1 addition & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Changes
* Bump default `ktlint` version to latest `1.7.1` -> `1.8.0`. ([2763](https://github.com/diffplug/spotless/pull/2763))
* Bump default `gherkin-utils` version to latest `9.2.0` -> `10.0.0`. ([#2619](https://github.com/diffplug/spotless/pull/2619))
- Fix null pointer exception when git ignored files are checked in ([911](https://github.com/diffplug/spotless/issues/911))
Copy link
Contributor

@Pankraz76 Pankraz76 Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considering fixed block.

### Fixed

Thanks for your good template. it was simple to continue thanks to your contribution.


## [8.1.0] - 2025-11-18
### Changes
Expand Down
1 change: 1 addition & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
### Changes
* Bump default `ktlint` version to latest `1.7.1` -> `1.8.0`. ([2763](https://github.com/diffplug/spotless/pull/2763))
* Bump default `gherkin-utils` version to latest `9.2.0` -> `10.0.0`. ([#2619](https://github.com/diffplug/spotless/pull/2619))
- Fix null pointer exception when git ignored files are checked in ([911](https://github.com/diffplug/spotless/issues/911))

## [3.1.0] - 2025-11-18
### Changes
Expand Down
Loading