summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Bhuleskar <funronald@google.com>2022-08-05 14:23:17 -0700
committerRonald Bhuleskar <funronald@google.com>2022-08-05 17:25:54 -0400
commit05a2485075d86c535a6c5ca02533048d4a7a0186 (patch)
tree6f03c82cbc60219bf7346cbd4e96c577df95fdcc
parent1c7b4a580f7081c483c3249115d14ea0485f228b (diff)
downloadjgit-05a2485075d86c535a6c5ca02533048d4a7a0186.tar.gz
jgit-05a2485075d86c535a6c5ca02533048d4a7a0186.zip
Provide a default implementation for set/get shallowCommits on DfsObjDatabase
Jgit change https://git.eclipse.org/r/c/jgit/jgit/+/193329 adds an implementation for get/set shallow commits in ObjectDatabase. This failed gerrit's acceptance tests since there is no default implementation for them in DfsObjDatabase. Change-Id: I649db9ae679ec2606cf7c530b040f8b6b93eb81a
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java16
1 files changed, 16 insertions, 0 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 46ec87df54..c50e03869c 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,6 +29,7 @@ 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;
@@ -57,6 +58,8 @@ public abstract class DfsObjDatabase extends ObjectDatabase {
}
};
+ private static final Set<ObjectId> shallowCommits = Collections.emptySet();
+
/**
* Sources for a pack file.
* <p>
@@ -504,6 +507,19 @@ 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 {