Skip to content

Commit

Permalink
Set the rootDir as / instead of // if the project is in the root of t…
Browse files Browse the repository at this point in the history
…he filesystem (#732)
  • Loading branch information
nedtwigg authored Nov 16, 2020
2 parents 5d965e7 + 2f01155 commit 23f8d69
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ This document is intended for Spotless developers.
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).

## [Unreleased]
### Fixed
* Fixed a bug which occurred if the root directory of the project was also the filesystem root ([#732](https://github.com/diffplug/spotless/pull/732))

## [2.10.1] - 2020-11-13
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ static class CachedEndings implements Serializable {
final ConcurrentRadixTree<String> hasNonDefaultEnding = new ConcurrentRadixTree<>(new DefaultCharSequenceNodeFactory());

CachedEndings(File projectDir, Runtime runtime, Iterable<File> toFormat) {
rootDir = FileSignature.pathNativeToUnix(projectDir.getAbsolutePath()) + "/";
String rootPath = FileSignature.pathNativeToUnix(projectDir.getAbsolutePath());
rootDir = rootPath.equals("/") ? rootPath : rootPath + "/";
defaultEnding = runtime.defaultEnding;
for (File file : toFormat) {
String ending = runtime.getEndingFor(file);
Expand Down
2 changes: 2 additions & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).

## [Unreleased]
### Fixed
* Fixed a bug which occurred if the root directory of the project was also the filesystem root ([#732](https://github.com/diffplug/spotless/pull/732))

## [5.8.1] - 2020-11-13
### Fixed
Expand Down
2 changes: 2 additions & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).

## [Unreleased]
### Fixed
* Fixed a bug which occurred if the root directory of the project was also the filesystem root ([#732](https://github.com/diffplug/spotless/pull/732))

## [2.6.0] - 2020-11-13
### Added
Expand Down

0 comments on commit 23f8d69

Please sign in to comment.