Fix For JENKINS-16851

It is probably fixed in git plugin v. 1.1.29
this commit should remove any use of deprecated APIs.
But when I test this I gen something very similar to
JENKINS-16849 at the end of the build.