fix for issue 4
Merge branch 'issue4' of https://github.com/nenadv/git2 into issue4