From 4df58a5af9c3be03358eb0aedb8e272d091cbf6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Tue, 12 Dec 2023 12:27:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=9D=E3=82=B8=E3=83=88=E3=83=AA?= =?UTF-8?q?=E4=BD=9C=E6=88=90=E3=83=AD=E3=82=B8=E3=83=83=E3=82=AF=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/one/nem/lacerta/source/jgit/RepoUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/source/jgit/RepoUtils.java b/data/src/main/java/one/nem/lacerta/source/jgit/RepoUtils.java index 765ab295..85fa3c64 100644 --- a/data/src/main/java/one/nem/lacerta/source/jgit/RepoUtils.java +++ b/data/src/main/java/one/nem/lacerta/source/jgit/RepoUtils.java @@ -4,6 +4,7 @@ import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.storage.file.FileRepositoryBuilder; +import java.io.File; import java.nio.file.Path; import javax.inject.Inject; @@ -25,8 +26,9 @@ public class RepoUtils { Path rootPath = fileUtils.getExternalFilesDirPath(); try { - Repository repo = new FileRepository(rootPath.resolve(id).resolve(".git").toFile()); - repo.create(); + Repository repo = FileRepositoryBuilder.create( + new File(rootPath.resolve(id).resolve(".git").toString()) + ); return repo; } catch (Exception e) { // TODO-rca: handle exception