Fix #5587 (quickfix)

Check that the numbers from git are not empty strings before pasting
them into `version_git.jl`.
Merge pull request #5590 from ivarne/quickfix_5587

Fix #5587 (quickfix)