aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf <twolf@apache.org>2022-09-18 19:29:22 +0200
committerThomas Wolf <twolf@apache.org>2022-09-18 19:32:31 +0200
commit4f4204914c6c996c4ffd81a26b8d9b0898523cdb (patch)
tree977c3bf2c77c624a47f898ce1a5a20aa2e0a6db1
parentccad49a28c9f28bdfc0f0d810dde44139f1c0895 (diff)
downloadjgit-4f4204914c6c996c4ffd81a26b8d9b0898523cdb.tar.gz
jgit-4f4204914c6c996c4ffd81a26b8d9b0898523cdb.zip
Pass on shallowSince only if not null
FetchCommand.setShallowSince() and Transport.setDeepenSince() require a non-null argument. Change-Id: I1c3a20be518374e380a4e90787ed834438da40ee Signed-off-by: Thomas Wolf <twolf@apache.org>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java4
2 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
index 1f979a938c..87c95ec830 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
@@ -318,7 +318,9 @@ public class CloneCommand extends TransportCommand<CloneCommand, Git> {
if (depth != null) {
command.setDepth(depth.intValue());
}
- command.setShallowSince(shallowSince);
+ if (shallowSince != null) {
+ command.setShallowSince(shallowSince);
+ }
command.setShallowExcludes(shallowExcludes);
configure(command);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
index 84bee36204..e7a8be0432 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java
@@ -227,7 +227,9 @@ public class FetchCommand extends TransportCommand<FetchCommand, FetchResult> {
}
transport.setDepth(Constants.INFINITE_DEPTH);
}
- transport.setDeepenSince(deepenSince);
+ if (deepenSince != null) {
+ transport.setDeepenSince(deepenSince);
+ }
transport.setDeepenNots(shallowExcludes);
configure(transport);
FetchResult result = transport.fetch(monitor,