Add assertions for git 2.0.0 from Debian testing

Formatted the file with Netbeans to improve readability and consistency.
Move duplicate JENKINS-23424 test code to private method, call twice
Declare exception which is thrown