mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
リポジトリ作成ロジック修正
This commit is contained in:
parent
4df58a5af9
commit
c4427313b0
|
@ -18,10 +18,11 @@ public class DebugFuncImpl implements DebugFunc {
|
||||||
RepoUtils repoUtils;
|
RepoUtils repoUtils;
|
||||||
|
|
||||||
public Repository getOrCreateRepositoryById(String id) {
|
public Repository getOrCreateRepositoryById(String id) {
|
||||||
Repository repo = repoUtils.getRepo(id); // TODO-rca: リポジトリの存在確認をもうすこしなんとかする
|
// Repository repo = repoUtils.getRepo(id); // TODO-rca: リポジトリの存在確認をもうすこしなんとかする
|
||||||
if (repo == null) {
|
// if (repo == null) {
|
||||||
repo = repoUtils.createRepo(id);
|
// repo = repoUtils.createRepo(id);
|
||||||
}
|
// }
|
||||||
|
Repository repo = repoUtils.createRepo(id); // debug
|
||||||
return repo;
|
return repo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,8 @@ public class RepoUtils {
|
||||||
Path rootPath = fileUtils.getExternalFilesDirPath();
|
Path rootPath = fileUtils.getExternalFilesDirPath();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Repository repo = FileRepositoryBuilder.create(
|
Repository repo = new FileRepositoryBuilder().setGitDir(rootPath.resolve(id).resolve(".git").toFile()).build();
|
||||||
new File(rootPath.resolve(id).resolve(".git").toString())
|
repo.create();
|
||||||
);
|
|
||||||
return repo;
|
return repo;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO-rca: handle exception
|
// TODO-rca: handle exception
|
||||||
|
|
Loading…
Reference in New Issue
Block a user