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>
This commit is contained in:
Thomas Wolf 2022-09-18 19:29:22 +02:00
parent ccad49a28c
commit 4f4204914c
2 changed files with 6 additions and 2 deletions

View File

@ -318,7 +318,9 @@ private FetchResult fetch(Repository clonedRepo, URIish u)
if (depth != null) {
command.setDepth(depth.intValue());
}
command.setShallowSince(shallowSince);
if (shallowSince != null) {
command.setShallowSince(shallowSince);
}
command.setShallowExcludes(shallowExcludes);
configure(command);

View File

@ -227,7 +227,9 @@ public FetchResult call() throws GitAPIException, InvalidRemoteException,
}
transport.setDepth(Constants.INFINITE_DEPTH);
}
transport.setDeepenSince(deepenSince);
if (deepenSince != null) {
transport.setDeepenSince(deepenSince);
}
transport.setDeepenNots(shallowExcludes);
configure(transport);
FetchResult result = transport.fetch(monitor,