Remove getRepository() and make save() only work with String

This commit is contained in:
Paul Campbell 2018-05-13 09:22:31 +01:00
parent ab174f5eeb
commit 04d7acc06c
2 changed files with 3 additions and 8 deletions

View file

@ -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 {
<T> Stream<T> getFiles(Branch branch, Key key, Class<T> type);
<T> T save(Branch branch, Message message, Document<T> document, Author author);
String save(Branch branch, Message message, Document<String> document, Author author);
String delete(Branch branch, Key key, Message message, Author author);

View file

@ -52,7 +52,7 @@ class GitDBLocal implements GitDB {
}
@Override
public <T> T save(Branch branch, Message message, Document<T> document, Author author) {
public String save(Branch branch, Message message, Document<String> document, Author author) {
return document.getValue();
}