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).