</message_arguments>
</filter>
</resource>
- <resource path="src/org/eclipse/jgit/lib/ObjectDatabase.java" type="org.eclipse.jgit.lib.ObjectDatabase">
- <filter id="336695337">
- <message_arguments>
- <message_argument value="org.eclipse.jgit.lib.ObjectDatabase"/>
- <message_argument value="getShallowCommits()"/>
- </message_arguments>
- </filter>
- <filter id="336695337">
- <message_arguments>
- <message_argument value="org.eclipse.jgit.lib.ObjectDatabase"/>
- <message_argument value="setShallowCommits(Set<ObjectId>)"/>
- </message_arguments>
- </filter>
- </resource>
<resource path="src/org/eclipse/jgit/lib/TypedConfigGetter.java" type="org.eclipse.jgit.lib.TypedConfigGetter">
<filter id="403767336">
<message_arguments>
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;
}
};
- private static final Set<ObjectId> shallowCommits = Collections.emptySet();
-
/**
* Sources for a pack file.
* <p>
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 {
package org.eclipse.jgit.lib;
import java.io.IOException;
+import java.util.Collections;
import java.util.Set;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
* {@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.
*/
*
* @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
*
* @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.