It's hard or even impossible to correctly free the string buffer allocated by git_patch_to_str in some circumstances. Drop the function so people have to use git_patch_to_buf instead - git_buf has a dedicated destructor.
This covers diff print, push, and ref foreach. This also has a fix for a small memory leak in the push tests.
For additions and deletions, external consumers like subversion can make use of the content offset to generate diffs in their proprietary formats.