From 17c9f4d47fef1cbf369146ffe99ece824e92374d Mon Sep 17 00:00:00 2001 From: Rudolf Visagie Date: Fri, 13 Nov 2020 09:26:02 -0500 Subject: [PATCH 1/2] Set the rootDir as / instead of // if the project is in the root of the filesystem --- .../com/diffplug/spotless/extra/GitAttributesLineEndings.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java b/lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java index bd7cbd992c..0642bd5dbe 100644 --- a/lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java +++ b/lib-extra/src/main/java/com/diffplug/spotless/extra/GitAttributesLineEndings.java @@ -108,7 +108,8 @@ static class CachedEndings implements Serializable { final ConcurrentRadixTree hasNonDefaultEnding = new ConcurrentRadixTree<>(new DefaultCharSequenceNodeFactory()); CachedEndings(File projectDir, Runtime runtime, Iterable 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); From 2f011559bb6e3651dc2476a438f7851b8efd2e3b Mon Sep 17 00:00:00 2001 From: Rudolf Visagie Date: Mon, 16 Nov 2020 05:47:01 -0500 Subject: [PATCH 2/2] Updated the root, gradle plugin, and maven plugin changelogs --- CHANGES.md | 2 ++ plugin-gradle/CHANGES.md | 2 ++ plugin-maven/CHANGES.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index eee18aeb20..9d2bb4ed91 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 5e48fdd9de..ba9cbb3979 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -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 diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 70b186a29e..69a904e8cb 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -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