refactored the git version extraction code to be shared between the update_git_rev.bat and BuildSetup.bat scripts. (cherry picked from commit f833d1ed)