diff options
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java | 16 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java | 17 |
2 files changed, 15 insertions, 18 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java index c50e03869c..46ec87df54 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java @@ -29,7 +29,6 @@ import java.util.concurrent.atomic.AtomicReference; import org.eclipse.jgit.internal.storage.pack.PackExt; import org.eclipse.jgit.lib.AnyObjectId; import org.eclipse.jgit.lib.ObjectDatabase; -import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectInserter; import org.eclipse.jgit.lib.ObjectReader; @@ -58,8 +57,6 @@ public abstract class DfsObjDatabase extends ObjectDatabase { } }; - private static final Set<ObjectId> shallowCommits = Collections.emptySet(); - /** * Sources for a pack file. * <p> @@ -507,19 +504,6 @@ public abstract class DfsObjDatabase extends ObjectDatabase { protected abstract DfsOutputStream writeFile( DfsPackDescription desc, PackExt ext) throws IOException; - @Override - public Set<ObjectId> getShallowCommits() throws IOException { - return shallowCommits; - } - - @Override - public void setShallowCommits(Set<ObjectId> shallowCommits) { - if (!shallowCommits.isEmpty()) { - throw new UnsupportedOperationException( - "Shallow commits expected to be empty."); - } - } - void addPack(DfsPackFile newPack) throws IOException { PackList o, n; do { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java index 1c0f436090..a39766cbd0 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java @@ -11,6 +11,7 @@ package org.eclipse.jgit.lib; import java.io.IOException; +import java.util.Collections; import java.util.Set; import org.eclipse.jgit.errors.IncorrectObjectTypeException; @@ -23,6 +24,9 @@ import org.eclipse.jgit.errors.MissingObjectException; * {@link org.eclipse.jgit.lib.ObjectId}. */ public abstract class ObjectDatabase implements AutoCloseable { + + private static final Set<ObjectId> shallowCommits = Collections.emptySet(); + /** * Initialize a new database instance for access. */ @@ -79,7 +83,10 @@ public abstract class ObjectDatabase implements AutoCloseable { * * @since 6.3 */ - public abstract Set<ObjectId> getShallowCommits() throws IOException; + public Set<ObjectId> getShallowCommits() throws IOException { + return shallowCommits; + } + /** * Update the shallow commits of the current repository @@ -90,7 +97,13 @@ public abstract class ObjectDatabase implements AutoCloseable { * * @since 6.3 */ - public abstract void setShallowCommits(Set<ObjectId> shallowCommits) throws IOException; + public void setShallowCommits(Set<ObjectId> shallowCommits) + throws IOException { + if (!shallowCommits.isEmpty()) { + throw new UnsupportedOperationException( + "Shallow commits expected to be empty."); //$NON-NLS-1$ + } + } /** * Close any resources held by this database. |