Fix for handling of initial commits to git repository and VCS integration

This pull request should fix the issue #2208, allowing the first git commit to be stored in the TBG database. I had to modify the core code for VCS integration in addition to hook in order to allow this (the old code's logic was a bit flawed due to way how PHP converts '0000000000000' to an integer 0).

The patch has not been tested against master, though, since VCS integration seems to be a bit broken there (can't configure it). The patch still applied cleanly, though.