From 05a2485075d86c535a6c5ca02533048d4a7a0186 Mon Sep 17 00:00:00 2001 From: Ronald Bhuleskar Date: Fri, 5 Aug 2022 14:23:17 -0700 Subject: [PATCH] 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 --- .../internal/storage/dfs/DfsObjDatabase.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 46ec87df5..c50e03869 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 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 void markDirty() { } }; + private static final Set shallowCommits = Collections.emptySet(); + /** * Sources for a pack file. *

@@ -504,6 +507,19 @@ protected abstract ReadableChannel openFile( protected abstract DfsOutputStream writeFile( DfsPackDescription desc, PackExt ext) throws IOException; + @Override + public Set getShallowCommits() throws IOException { + return shallowCommits; + } + + @Override + public void setShallowCommits(Set shallowCommits) { + if (!shallowCommits.isEmpty()) { + throw new UnsupportedOperationException( + "Shallow commits expected to be empty."); + } + } + void addPack(DfsPackFile newPack) throws IOException { PackList o, n; do {