DebugFunc実装

This commit is contained in:
ろむねこ 2023-12-12 11:35:28 +09:00
parent ef6431afbc
commit 31fcdd788a
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168
2 changed files with 30 additions and 2 deletions

View File

@ -1,4 +1,27 @@
package one.nem.lacerta.data.impl;
public class DebugFuncImpl {
import org.eclipse.jgit.lib.Repository;
import javax.inject.Inject;
import one.nem.lacerta.data.repository.DebugFunc;
import one.nem.lacerta.source.jgit.RepoUtils;
import one.nem.lacerta.utils.repository.FileUtils;
public class DebugFuncImpl implements DebugFunc {
@Inject
public DebugFuncImpl() {
}
@Inject
RepoUtils repoUtils;
public Repository getOrCreateRepositoryById(String id) {
Repository repo = repoUtils.getRepo(id); // TODO-rca: リポジトリの存在確認をもうすこしなんとかする
if (repo == null) {
repo = repoUtils.createRepo(id);
}
return repo;
}
}

View File

@ -1,4 +1,9 @@
package one.nem.lacerta.data.repository;
public class DebugFunc {
import org.eclipse.jgit.lib.Repository;
public interface DebugFunc {
Repository getOrCreateRepositoryById(String id);
}