From eccae7cf0bb1ffd4425b6961597b28a8510fc42c Mon Sep 17 00:00:00 2001 From: Xing Huang Date: Mon, 6 Feb 2023 14:18:16 -0600 Subject: 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 Change-Id: I38eeacff76c7f926b6dfb192d1e5916e40770024 --- org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectReader.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib') 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 getCommitGraph() { + public Optional getCommitGraph() throws IOException { return Optional.empty(); } @@ -661,7 +664,7 @@ public abstract class ObjectReader implements AutoCloseable { } @Override - public Optional getCommitGraph() { + public Optional getCommitGraph() throws IOException{ return delegate().getCommitGraph(); } -- cgit v1.2.3