[JENKINS-25387] Allow reference repositories for JGit as well.

While JGit Clone and Init commands do not support a reference argument
directly, the same result can be reached using JGit API directly, by
separating clone into a creation step using the repository builder and a
regular fetch.