[COOK-4392] Fix env variables for git config to work

Make it more robust, less complicated
Just fine!

https://tickets.opscode.com/browse/COOK-4392