build-go.sh: use OS_GIT_COMMIT if available
This will be supplied in downstream builds to relay the commit from the source git repo.
@@ -20,7 +20,7 @@ if [ -z ${VERSION_OVERRIDE+a} ]; then
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
fi
-HASH=$(git rev-parse --verify 'HEAD^{commit}')
+HASH=${OS_GIT_COMMIT:-$(git rev-parse --verify 'HEAD^{commit}')}
GLDFLAGS+="-X ${REPO}/pkg/version.Raw=${VERSION_OVERRIDE} -X ${REPO}/pkg/version.Hash=${HASH}"
