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 765ab295..85fa3c64 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 @@ -4,6 +4,7 @@ import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.storage.file.FileRepositoryBuilder; +import java.io.File; import java.nio.file.Path; import javax.inject.Inject; @@ -25,8 +26,9 @@ public class RepoUtils { Path rootPath = fileUtils.getExternalFilesDirPath(); try { - Repository repo = new FileRepository(rootPath.resolve(id).resolve(".git").toFile()); - repo.create(); + Repository repo = FileRepositoryBuilder.create( + new File(rootPath.resolve(id).resolve(".git").toString()) + ); return repo; } catch (Exception e) { // TODO-rca: handle exception