From 5b6f5a2eba5b401b0edee9c67ddb0afb36f6418d Mon Sep 17 00:00:00 2001 From: Ben Gibson Date: Tue, 24 May 2022 16:21:19 +0100 Subject: [PATCH] Trim forward slash in file path substitution --- CHANGELOG.md | 1 + gradle.properties | 2 +- src/main/kotlin/uk/co/ben_gibson/git/link/git/File.kt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d136e5..56410e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ # GitLink Changelog ## [Unreleased] +- Trim forward slash character in file path substitution ## [4.1.5] - Revert host detection fix diff --git a/gradle.properties b/gradle.properties index 465a374..50913ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ pluginGroup = uk.co.ben_gibson.git.link pluginName = GitLink # SemVer format -> https://semver.org -pluginVersion = 4.1.5 +pluginVersion = 4.1.6 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. diff --git a/src/main/kotlin/uk/co/ben_gibson/git/link/git/File.kt b/src/main/kotlin/uk/co/ben_gibson/git/link/git/File.kt index 250e0a4..3ab298d 100644 --- a/src/main/kotlin/uk/co/ben_gibson/git/link/git/File.kt +++ b/src/main/kotlin/uk/co/ben_gibson/git/link/git/File.kt @@ -12,7 +12,7 @@ data class File(val name: String, val isDirectory: Boolean, val path: String, va return File( file.name, file.isDirectory, - file.path.substring(repository.root.path.length).replace(file.name, "").trimEnd('/'), + file.path.substring(repository.root.path.length).replace(file.name, "").trim('/'), file.path == repository.root.path ) }