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
[JENKINS-25444] CliGit implementation of fetch/deleteBranch does remove
open changes, JGit does not

Created testcase, perform a reset --hard in case of ref checkout an
branch with delete checkout to simulate CLI behaviour.
Fixed failing lock test.
Merge pull request #151 from pauxus/jgit-references

[JENKINS-25387] Allow reference repositories for JGit as well.
Specify file content encoding to PrintWriter - fix new findbugs warning
Merge remote-tracking branch 'upstream/master' into
JENKINS-25444-fetch-clean

Conflicts:
	src/main/java/org/jenkinsci/plugins/gitclient/JGitAPIImpl.java
	src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java
Merge pull request #153 from pauxus/JENKINS-25444-fetch-clean

[JENKINS-25444] CliGit implementation of fetch/deleteBranch does remove
Merge remote-tracking branch 'upstream/master' into proto-jdk8

Conflicts:
	src/main/java/hudson/plugins/git/Branch.java
	src/main/java/org/jenkinsci/plugins/gitclient/CloneCommand.java