This is a case where core Git does use the `git_buf_text_is_binary` algorithm for deciding what to do. See https://github.com/git/git/blob/master/convert.c#L187-L202 for the source.