Skip to content

Commit 790f51d

Browse files
Simplify code to improve the performance
1 parent 6a03773 commit 790f51d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

plugin/src/main/java/io/jenkins/plugins/forensics/git/util/GitRepositoryValidator.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,8 @@ public boolean isFullGitRepository() {
9696
* @return {@code true} if the repository is a shallow clone, {@code false} otherwise
9797
*/
9898
public boolean isShallowClone() {
99-
if (scm instanceof GitSCM) {
100-
return isShallow((GitSCM) scm);
101-
}
102-
return false;
99+
return scm instanceof GitSCM
100+
&& isShallow((GitSCM) scm);
103101
}
104102

105103
private boolean isValidGitRoot(final GitSCM git, final boolean rejectShallowClone) {

0 commit comments

Comments
 (0)