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