From 04d7acc06c49337d9849f81ee90f03f96019179f Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 13 May 2018 09:22:31 +0100 Subject: [PATCH] Remove getRepository() and make save() only work with String --- src/main/java/net/kemitix/gitdb/GitDB.java | 9 ++------- src/main/java/net/kemitix/gitdb/GitDBLocal.java | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/kemitix/gitdb/GitDB.java b/src/main/java/net/kemitix/gitdb/GitDB.java index 5164856..c63decd 100644 --- a/src/main/java/net/kemitix/gitdb/GitDB.java +++ b/src/main/java/net/kemitix/gitdb/GitDB.java @@ -1,21 +1,16 @@ package net.kemitix.gitdb; -import org.eclipse.jgit.api.errors.GitAPIException; -import org.eclipse.jgit.lib.Repository; - import java.nio.file.Path; import java.util.stream.Stream; public interface GitDB { - static GitDB local(Path dbDir) throws GitAPIException { + static GitDB local(Path dbDir) { return new GitDBLocal(dbDir); } void close(); - Repository getRepository(); - Path getGitDir(); String get(Branch branch, Key key); @@ -26,7 +21,7 @@ public interface GitDB { Stream getFiles(Branch branch, Key key, Class type); - T save(Branch branch, Message message, Document document, Author author); + String save(Branch branch, Message message, Document document, Author author); String delete(Branch branch, Key key, Message message, Author author); diff --git a/src/main/java/net/kemitix/gitdb/GitDBLocal.java b/src/main/java/net/kemitix/gitdb/GitDBLocal.java index 148e5fd..da4ff8f 100644 --- a/src/main/java/net/kemitix/gitdb/GitDBLocal.java +++ b/src/main/java/net/kemitix/gitdb/GitDBLocal.java @@ -52,7 +52,7 @@ class GitDBLocal implements GitDB { } @Override - public T save(Branch branch, Message message, Document document, Author author) { + public String save(Branch branch, Message message, Document document, Author author) { return document.getValue(); }