Cloning full Git repository can take a long time (in my case over 10 minutes which results in timeout).
In the freestyle project I can specify additional clone options like shallow clone. Unfortunatelny I cannot do this in Multibranch Pipeline project with Jenkinsfile.
I've tried modifying scm.extensions using code like this:
However when executed CloneOption is not added to extensions:
It would be nice if it was possible to add extensions to SCM via Jenkinsfile.