summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs
diff options
context:
space:
mode:
authorMarkus Duft <markus.duft@ssi-schaefer.com>2018-03-05 10:34:29 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2018-03-07 22:02:02 +0100
commit0f9ec9e406b903ab9be6a95e15a282da9a6c5512 (patch)
tree32ab0ee30f4e7a9ab971fe7bed20e015111e7d92 /org.eclipse.jgit.lfs
parent9f689e90d42a6405054df1f98e43902c87595317 (diff)
downloadjgit-0f9ec9e406b903ab9be6a95e15a282da9a6c5512.tar.gz
jgit-0f9ec9e406b903ab9be6a95e15a282da9a6c5512.zip
LFS: Adjust some API to make integration into tools (EGit,...) easier
Make the install command accessible without requiring reflection. Expose the isEnabled(Repository) API to be able to check if calling the install command is required for a repository. Change-Id: I17e6eaefb6afda17fea8162cbf0cb86a20506753 Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs')
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/BuiltinLFS.java8
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/InstallBuiltinLfsCommand.java (renamed from org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/InstallLfsCommand.java)7
2 files changed, 11 insertions, 4 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/BuiltinLFS.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/BuiltinLFS.java
index d65e4e9993..415caa9859 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/BuiltinLFS.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/BuiltinLFS.java
@@ -112,7 +112,8 @@ public class BuiltinLFS extends LfsFactory {
* the repository
* @return whether LFS is requested for the given repo.
*/
- private boolean isEnabled(Repository db) {
+ @Override
+ public boolean isEnabled(Repository db) {
if (db == null) {
return false;
}
@@ -138,4 +139,9 @@ public class BuiltinLFS extends LfsFactory {
.equals(attribute.getValue());
}
+ @Override
+ public LfsInstallCommand getInstallCommand() {
+ return new InstallBuiltinLfsCommand();
+ }
+
}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/InstallLfsCommand.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/InstallBuiltinLfsCommand.java
index b204d0c156..028b19b2ab 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/InstallLfsCommand.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/InstallBuiltinLfsCommand.java
@@ -44,7 +44,6 @@ package org.eclipse.jgit.lfs;
import java.io.IOException;
import java.text.MessageFormat;
-import java.util.concurrent.Callable;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lfs.internal.LfsText;
@@ -53,6 +52,7 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.storage.file.FileBasedConfig;
import org.eclipse.jgit.util.FS;
+import org.eclipse.jgit.util.LfsFactory.LfsInstallCommand;
import org.eclipse.jgit.util.SystemReader;
/**
@@ -61,7 +61,7 @@ import org.eclipse.jgit.util.SystemReader;
*
* @since 4.11
*/
-public class InstallLfsCommand implements Callable<Void>{
+public class InstallBuiltinLfsCommand implements LfsInstallCommand {
private static final String[] ARGS_USER = new String[] { "lfs", "install" }; //$NON-NLS-1$//$NON-NLS-2$
@@ -110,7 +110,8 @@ public class InstallLfsCommand implements Callable<Void>{
* configuration
* @return this command
*/
- public InstallLfsCommand setRepository(Repository repo) {
+ @Override
+ public LfsInstallCommand setRepository(Repository repo) {
this.repository = repo;
return this;
}