summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs
diff options
context:
space:
mode:
authorMarkus Duft <markus.duft@ssi-schaefer.com>2017-12-05 11:16:30 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2018-03-03 11:44:01 +0100
commitc0103bc59d5b4a539f01bc9c98610ab3f11be114 (patch)
tree8a1026680532ec1351f3728a340d4ed613a6f826 /org.eclipse.jgit.lfs
parenta3f8edbf6a915ab965039df02abf94b4cca891a5 (diff)
downloadjgit-c0103bc59d5b4a539f01bc9c98610ab3f11be114.tar.gz
jgit-c0103bc59d5b4a539f01bc9c98610ab3f11be114.zip
LFS: Enable LFS support for the CLI, better error handling
Enable LFS support for the CLI by registering the according filters. Errors during filter creation must be propagated up the call stack, as a failure to create a filter should be treated as fatal if the filter is required. Change-Id: I3833757839bdda97cd01b6c21c1613d199e2692d Signed-off-by: Markus Duft <markus.duft@ssi-schaefer.com>
Diffstat (limited to 'org.eclipse.jgit.lfs')
-rw-r--r--org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties1
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java5
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java1
3 files changed, 7 insertions, 0 deletions
diff --git a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties
index 29cee3a8e0..0e00f146ae 100644
--- a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties
+++ b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties
@@ -5,6 +5,7 @@ inconsistentContentLength=Unexpected content length reported by LFS server ({0})
invalidLongId=Invalid id: {0}
invalidLongIdLength=Invalid id length {0}; should be {1}
lfsUnavailable=LFS is not available for repository {0}
+protocolError=LFS Protocol Error {0}: {1}
requiredHashFunctionNotAvailable=Required hash function {0} not available.
repositoryNotFound=Repository {0} not found
repositoryReadOnly=Repository {0} is read-only
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java
index 5c0d3b47a7..e89b7b086b 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java
@@ -182,6 +182,11 @@ public class SmudgeFilter extends FilterCommand {
Protocol.Response resp = gson.fromJson(reader,
Protocol.Response.class);
for (Protocol.ObjectInfo o : resp.objects) {
+ if (o.error != null) {
+ throw new IOException(
+ MessageFormat.format(LfsText.get().protocolError,
+ o.error.code, o.error.message));
+ }
if (o.actions == null) {
continue;
}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
index d82ade2f7f..d7d0fe186a 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
@@ -67,6 +67,7 @@ public class LfsText extends TranslationBundle {
/***/ public String invalidLongId;
/***/ public String invalidLongIdLength;
/***/ public String lfsUnavailable;
+ /***/ public String protocolError;
/***/ public String requiredHashFunctionNotAvailable;
/***/ public String repositoryNotFound;
/***/ public String repositoryReadOnly;