Ensure strings are absent of extra zeroes
before reaching libgit2.

Fixes #571