From 4f4204914c6c996c4ffd81a26b8d9b0898523cdb Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 18 Sep 2022 19:29:22 +0200 Subject: [PATCH] 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 --- org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java | 4 +++- org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java | 4 +++- 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 { 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 { } transport.setDepth(Constants.INFINITE_DEPTH); } - transport.setDeepenSince(deepenSince); + if (deepenSince != null) { + transport.setDeepenSince(deepenSince); + } transport.setDeepenNots(shallowExcludes); configure(transport); FetchResult result = transport.fetch(monitor, -- 2.39.5