From c4427313b048aa4ce6c208e6be5b325a92a70029 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:39:37 +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 --- .../java/one/nem/lacerta/data/impl/DebugFuncImpl.java | 9 +++++---- .../main/java/one/nem/lacerta/source/jgit/RepoUtils.java | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DebugFuncImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DebugFuncImpl.java index 98685f0f..952f6a31 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DebugFuncImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DebugFuncImpl.java @@ -18,10 +18,11 @@ public class DebugFuncImpl implements DebugFunc { RepoUtils repoUtils; public Repository getOrCreateRepositoryById(String id) { - Repository repo = repoUtils.getRepo(id); // TODO-rca: リポジトリの存在確認をもうすこしなんとかする - if (repo == null) { - repo = repoUtils.createRepo(id); - } +// Repository repo = repoUtils.getRepo(id); // TODO-rca: リポジトリの存在確認をもうすこしなんとかする +// if (repo == null) { +// repo = repoUtils.createRepo(id); +// } + Repository repo = repoUtils.createRepo(id); // debug return repo; } } 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 85fa3c64..134f8117 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 @@ -26,9 +26,8 @@ public class RepoUtils { Path rootPath = fileUtils.getExternalFilesDirPath(); try { - Repository repo = FileRepositoryBuilder.create( - new File(rootPath.resolve(id).resolve(".git").toString()) - ); + Repository repo = new FileRepositoryBuilder().setGitDir(rootPath.resolve(id).resolve(".git").toFile()).build(); + repo.create(); return repo; } catch (Exception e) { // TODO-rca: handle exception