[git] IDEA-120042 Protect against zero timestamp

(cherry picked from commit 31f68579ee0117ee394ff9350e616cd91cbb004b)