If GIT_DEEP is set, do not do shallow checkout.

This is helpful during setting of tags for releases.
(cherry picked from commit 045e399bfef6bae1353b2d116d30a5520ff2a40f)