tools: Move sha check to else statement (#50773)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50773
Moves the sha check for version generation to the else clause
since it was causing issues for users building pytorch when the .git
directory was not present and PYTORCH_BUILD_VERSION was already set
Test Plan:
CI
Closes https://github.com/pytorch/pytorch/issues/50730
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Reviewed By: janeyx99
Differential Revision: D25963486
Pulled By: seemethere
fbshipit-source-id: ce1b315f878d074f2ffb6b658d59cbd13150f27f