pygit2
pygit2 copied to clipboard
Fix Signature repr()
to_unicode() expects a non-NULL x argument (due to strlen(x));
however self->encoding may be NULL, especially if built with
build_signature() (i.e. if called from the commit.author property).
As a result, any repr() on a Signature with a NULL encoding will
cause a segfault.
Other functions manually map NULL to "utf-8" (see
Signature__encoding__get__()), so we'll do the same thing here.