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.
Fixed tests.
Merge branch 'jgit-references' of https://github.com/pauxus/git-client-plugin into master-pauxus-jgit-references
Enable test_branchContainingRemote - broken by changes, needs work

Also removed the ugly adaptCliGitClone method, replacing it with the
more direct, and more clear "git.checkout()" call.
Merge pull request #1 from MarkEWaite/master-pauxus-jgit-references

Test simplification and more
Adjusted JGit checkout to match CliGit.

Now if the checkout ref is a simple branch name, and no local branch
exists and there is exactly ONE remote branch with that name, a new
local branch is created and checked out, tracking that remote branch.
(Re-)activated 'shared' clones.

Shared now works as a special case of references.

Fixed test for JENKINS-20153
JGit ignored the references settings when reusing the repo.

- Expanded test to check for actual usage of references (i.e. no objects
in the cloned repo)
- applied a workaround for JGit behaviour
Merge pull request #151 from pauxus/jgit-references

[JENKINS-25387] Allow reference repositories for JGit as well.
Merge commit 'f330cd9e4dc1301830b432e26cd313ca7b812aaf' into HEAD