]> source.dussan.org Git - jgit.git/commitdiff
Pass on shallowSince only if not null 81/195881/1
authorThomas Wolf <twolf@apache.org>
Sun, 18 Sep 2022 17:29:22 +0000 (19:29 +0200)
committerThomas Wolf <twolf@apache.org>
Sun, 18 Sep 2022 17:32:31 +0000 (19:32 +0200)
FetchCommand.setShallowSince() and Transport.setDeepenSince() require
a non-null argument.

Change-Id: I1c3a20be518374e380a4e90787ed834438da40ee
Signed-off-by: Thomas Wolf <twolf@apache.org>
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/FetchCommand.java

index 1f979a938c207d22fe569729e847cf73b9151e2d..87c95ec83081bc829bc6bb5434a95208945bcb47 100644 (file)
@@ -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);
 
index 84bee3620478f75f36330851763e4c3aa2db709b..e7a8be0432c19c6804528908dc9a81865da83a26 100644 (file)
@@ -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,