Skip to content

Commit 23f8d69

Browse files
authored
Set the rootDir as / instead of // if the project is in the root of the filesystem (#732)
2 parents 5d965e7 + 2f01155 commit 23f8d69

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ This document is intended for Spotless developers.
1010
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
1111

1212
## [Unreleased]
13+
### Fixed
14+
* 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))
1315

1416
## [2.10.1] - 2020-11-13
1517
### Fixed

lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ static class CachedEndings implements Serializable {
108108
final ConcurrentRadixTree<String> hasNonDefaultEnding = new ConcurrentRadixTree<>(new DefaultCharSequenceNodeFactory());
109109

110110
CachedEndings(File projectDir, Runtime runtime, Iterable<File> toFormat) {
111-
rootDir = FileSignature.pathNativeToUnix(projectDir.getAbsolutePath()) + "/";
111+
String rootPath = FileSignature.pathNativeToUnix(projectDir.getAbsolutePath());
112+
rootDir = rootPath.equals("/") ? rootPath : rootPath + "/";
112113
defaultEnding = runtime.defaultEnding;
113114
for (File file : toFormat) {
114115
String ending = runtime.getEndingFor(file);

plugin-gradle/CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `3.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* 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))
68

79
## [5.8.1] - 2020-11-13
810
### Fixed

plugin-maven/CHANGES.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (starting after version `1.27.0`).
44

55
## [Unreleased]
6+
### Fixed
7+
* 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))
68

79
## [2.6.0] - 2020-11-13
810
### Added

0 commit comments

Comments
 (0)