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
This commit is contained in:
parent
1c7b4a580f
commit
05a2485075
|
@ -29,6 +29,7 @@
|
||||||
import org.eclipse.jgit.internal.storage.pack.PackExt;
|
import org.eclipse.jgit.internal.storage.pack.PackExt;
|
||||||
import org.eclipse.jgit.lib.AnyObjectId;
|
import org.eclipse.jgit.lib.AnyObjectId;
|
||||||
import org.eclipse.jgit.lib.ObjectDatabase;
|
import org.eclipse.jgit.lib.ObjectDatabase;
|
||||||
|
import org.eclipse.jgit.lib.ObjectId;
|
||||||
import org.eclipse.jgit.lib.ObjectInserter;
|
import org.eclipse.jgit.lib.ObjectInserter;
|
||||||
import org.eclipse.jgit.lib.ObjectReader;
|
import org.eclipse.jgit.lib.ObjectReader;
|
||||||
|
|
||||||
|
@ -57,6 +58,8 @@ public void markDirty() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static final Set<ObjectId> shallowCommits = Collections.emptySet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sources for a pack file.
|
* Sources for a pack file.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -504,6 +507,19 @@ protected abstract ReadableChannel openFile(
|
||||||
protected abstract DfsOutputStream writeFile(
|
protected abstract DfsOutputStream writeFile(
|
||||||
DfsPackDescription desc, PackExt ext) throws IOException;
|
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 {
|
void addPack(DfsPackFile newPack) throws IOException {
|
||||||
PackList o, n;
|
PackList o, n;
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in New Issue