mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2026-11-02 11:37:37 +00:00
リポジトリ作成ロジック修正
This commit is contained in:
2 files changed
+7
-7
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user