壊れた場所を修正

This commit is contained in:
r-ca 2023-12-16 16:19:35 +09:00
parent d23e8510db
commit 95dafdebe5
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 8 additions and 4 deletions

View File

@ -1,11 +1,13 @@
package one.nem.lacerta.source.jgit;
import org.eclipse.jgit.lib.Repository;
public interface JGitRepository {
// リポジトリ取得
org.eclipse.jgit.lib.Repository getRepository(String id);
Repository getRepository(String id);
// リポジトリ作成
org.eclipse.jgit.lib.Repository createRepository(String id);
Repository createRepository(String id);
// リポジトリ削除
void deleteRepository(String id);
// リポジトリ存在確認

View File

@ -6,6 +6,8 @@ import javax.inject.Inject;
import one.nem.lacerta.utils.repository.DeviceInfoUtils;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryBuilder;
public class JGitRepositoryImpl implements JGitRepository {
@ -18,7 +20,7 @@ public class JGitRepositoryImpl implements JGitRepository {
}
@Override
public org.eclipse.jgit.lib.Repository getRepository(String id) {
public Repository getRepository(String id) {
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
repositoryBuilder.setMustExist(true);
@ -30,7 +32,7 @@ public class JGitRepositoryImpl implements JGitRepository {
}
@Override
public org.eclipse.jgit.lib.Repository createRepository(String id) {
public Repository createRepository(String id) {
RepositoryBuilder repositoryBuilder = new RepositoryBuilder();
repositoryBuilder.setGitDir(deviceInfoUtils.getExternalStorageDirectory().resolve(id).resolve(".git").toFile());
repositoryBuilder.setMustExist(false);