This looks like it will fail if textForGit overruns the buffer, presumably with an IOException. At the very least can you document in the docstring that there is an implicit maximum length of textForGit?

It would be better to handle arbitrary length messages. ISTR at least one instance you wrote of a message much longer than 128 bytes.