From 220854401efff37c955680e83d2c3de7051590d0 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 20 Feb 2023 11:08:49 +0400 Subject: [PATCH] #92 -- Fix .git removing --- .../ru/ulstu/extractor/gitrepository/model/GitRepository.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/ulstu/extractor/gitrepository/model/GitRepository.java b/src/main/java/ru/ulstu/extractor/gitrepository/model/GitRepository.java index da94301..652faf3 100644 --- a/src/main/java/ru/ulstu/extractor/gitrepository/model/GitRepository.java +++ b/src/main/java/ru/ulstu/extractor/gitrepository/model/GitRepository.java @@ -31,6 +31,8 @@ public class GitRepository extends BaseEntity { } private String removeDotGit(String prevName) { - return prevName.substring(0, prevName.lastIndexOf(".git")); + return prevName.lastIndexOf(".git") > 0 + ? prevName.substring(0, prevName.lastIndexOf(".git")) + : prevName; } }