diff --git a/src/main/kotlin/app/viewmodels/CloneViewModel.kt b/src/main/kotlin/app/viewmodels/CloneViewModel.kt index ac62449..6b388e8 100644 --- a/src/main/kotlin/app/viewmodels/CloneViewModel.kt +++ b/src/main/kotlin/app/viewmodels/CloneViewModel.kt @@ -47,7 +47,11 @@ class CloneViewModel @Inject constructor( } // Take the last element of the path/URL to generate obtain the repo name - val repoName = urlSplit.lastOrNull()?.replace(".git", "") + var repoName = urlSplit.lastOrNull() + + if(repoName?.endsWith(".git") == true) { + repoName = repoName.removeSuffix(".git") + } if (repoName.isNullOrBlank()) { _cloneStatus.value = CloneStatus.Fail("Check your URL and try again")