aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/errors
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2019-04-09 10:44:06 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2019-04-11 10:55:45 +0200
commitd6e00d201514ce69addcbfb1c7163f42336f3e66 (patch)
treeb14fa9fc05a83f683ff184724a23cd06be986a98 /org.eclipse.jgit/src/org/eclipse/jgit/errors
parentaa6e7e2c12efc85e11afd5b9cbf2b42bfb09a4c0 (diff)
downloadjgit-d6e00d201514ce69addcbfb1c7163f42336f3e66.tar.gz
jgit-d6e00d201514ce69addcbfb1c7163f42336f3e66.zip
Remember the cause for invalidating a packfile
Keep track of the original cause for a packfile invalidation. It is needed for the sysadmin to understand if there is a real underlying filesystem problem and repository corruption or if it is simply a consequence of a concurrency of Git operations (e.g. repack or GC). Change-Id: I06ddda9ec847844ec31616ab6d17f153a5a34e33 Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com> Signed-off-by: David Pursehouse <david.pursehouse@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/errors')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java34
1 files changed, 32 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java
index 8c216c3d41..09be9ec349 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/PackInvalidException.java
@@ -58,9 +58,24 @@ public class PackInvalidException extends IOException {
*
* @param path
* path of the invalid pack file.
+ * @deprecated Use {@link #PackInvalidException(File, Throwable)}.
*/
+ @Deprecated
public PackInvalidException(final File path) {
- this(path.getAbsolutePath());
+ this(path, null);
+ }
+
+ /**
+ * Construct a pack invalid error with cause.
+ *
+ * @param path
+ * path of the invalid pack file.
+ * @param cause
+ * cause of the pack file becoming invalid.
+ * @since 4.5.7
+ */
+ public PackInvalidException(final File path, Throwable cause) {
+ this(path.getAbsolutePath(), cause);
}
/**
@@ -68,8 +83,23 @@ public class PackInvalidException extends IOException {
*
* @param path
* path of the invalid pack file.
+ * @deprecated Use {@link #PackInvalidException(String, Throwable)}.
*/
+ @Deprecated
public PackInvalidException(final String path) {
- super(MessageFormat.format(JGitText.get().packFileInvalid, path));
+ this(path, null);
+ }
+
+ /**
+ * Construct a pack invalid error with cause.
+ *
+ * @param path
+ * path of the invalid pack file.
+ * @param cause
+ * cause of the pack file becoming invalid.
+ * @since 4.5.7
+ */
+ public PackInvalidException(final String path, Throwable cause) {
+ super(MessageFormat.format(JGitText.get().packFileInvalid, path), cause);
}
}