aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib
diff options
context:
space:
mode:
authorXing Huang <xingkhuang@google.com>2023-02-06 14:18:16 -0600
committerIvan Frade <ifrade@google.com>2023-02-07 11:32:12 -0500
commiteccae7cf0bb1ffd4425b6961597b28a8510fc42c (patch)
treed7e0a50c7bf51d38be115a697b1b86b2f5d341d2 /org.eclipse.jgit/src/org/eclipse/jgit/lib
parente8042d02e65ca58c9f9eb890a7f353833b5c9e6e (diff)
downloadjgit-eccae7cf0bb1ffd4425b6961597b28a8510fc42c.tar.gz
jgit-eccae7cf0bb1ffd4425b6961597b28a8510fc42c.zip
ObjectReader: Allow getCommitGraph to throw IOException
ObjectReader#getCommitGraph doesn't report errors loading the commit graph. The caller should be aware of the situation and ultimately decide what to do. Add IOException to ObjectReader#getCommitGraph signature. RevWalk defaults to an empty commit-graph on IO errors. Signed-off-by: Xing Huang <xingkhuang@google.com> Change-Id: I38eeacff76c7f926b6dfb192d1e5916e40770024
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
index ae0cf42b12..69b2b5104e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java
@@ -512,9 +512,12 @@ public abstract class ObjectReader implements AutoCloseable {
* (default is
* {@value org.eclipse.jgit.lib.CoreConfig#DEFAULT_COMMIT_GRAPH_ENABLE}).
*
+ * @throws IOException
+ * if it cannot open any of the underlying commit graph.
+ *
* @since 6.5
*/
- public Optional<CommitGraph> getCommitGraph() {
+ public Optional<CommitGraph> getCommitGraph() throws IOException {
return Optional.empty();
}
@@ -661,7 +664,7 @@ public abstract class ObjectReader implements AutoCloseable {
}
@Override
- public Optional<CommitGraph> getCommitGraph() {
+ public Optional<CommitGraph> getCommitGraph() throws IOException{
return delegate().getCommitGraph();
}