aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java
diff options
context:
space:
mode:
authorRobin Müller <eclipse@mail.coder-hugo.de>2022-05-13 13:46:13 +0200
committerThomas Wolf <twolf@apache.org>2022-07-31 14:08:47 +0200
commit207dd4c938830e84c9101d30edb7fe626e04bbe1 (patch)
tree7279856259550f207ac821d2ab83ecf3b4687acc /org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java
parent559be665296e7587e3ff0425152b631c93b4b56d (diff)
downloadjgit-207dd4c938830e84c9101d30edb7fe626e04bbe1.tar.gz
jgit-207dd4c938830e84c9101d30edb7fe626e04bbe1.zip
Fetch: add support for shallow
This adds support for shallow cloning. The CloneCommand and the FetchCommand now have the new methods setDepth, setShallowSince and addShallowExclude to tell the server that the client doesn't want to download the complete history. Bug: 475615 Change-Id: Ic80fb6efb5474543ae59be590ebe385bec21cc0d
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java23
1 files changed, 22 insertions, 1 deletions
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 70009cba35..1c0f436090 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectDatabase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, Google Inc. and others
+ * Copyright (C) 2009, 2022 Google Inc. and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0 which is available at
@@ -11,6 +11,7 @@
package org.eclipse.jgit.lib;
import java.io.IOException;
+import java.util.Set;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
@@ -72,6 +73,26 @@ public abstract class ObjectDatabase implements AutoCloseable {
public abstract ObjectReader newReader();
/**
+ * @return the shallow commits of the current repository
+ *
+ * @throws IOException the database could not be read
+ *
+ * @since 6.3
+ */
+ public abstract Set<ObjectId> getShallowCommits() throws IOException;
+
+ /**
+ * Update the shallow commits of the current repository
+ *
+ * @param shallowCommits the new shallow commits
+ *
+ * @throws IOException the database could not be updated
+ *
+ * @since 6.3
+ */
+ public abstract void setShallowCommits(Set<ObjectId> shallowCommits) throws IOException;
+
+ /**
* Close any resources held by this database.
*/
@Override