diff options
author | Markus Duft <markus.duft@ssi-schaefer.com> | 2017-12-05 11:16:30 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-03-03 11:44:01 +0100 |
commit | c0103bc59d5b4a539f01bc9c98610ab3f11be114 (patch) | |
tree | 8a1026680532ec1351f3728a340d4ed613a6f826 /org.eclipse.jgit.lfs/src/org | |
parent | a3f8edbf6a915ab965039df02abf94b4cca891a5 (diff) | |
download | jgit-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/src/org')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java | 5 | ||||
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java | 1 |
2 files changed, 6 insertions, 0 deletions
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; |