summaryrefslogtreecommitdiff
path: root/src/diff_print.c
diff options
context:
space:
mode:
authorNicolas Hake <nh@nosebud.de>2014-01-22 17:51:32 +0100
committerNicolas Hake <nh@nosebud.de>2014-01-22 17:51:32 +0100
commitc05cd7924d2409741bb4cb1eb3ba843bea7ec4a2 (patch)
tree548900c29909e116ec5c3c1fe41370bef3460ac5 /src/diff_print.c
parent450e8e9e623b8c172ba4628c146838cbf4c56519 (diff)
downloadlibgit2-c05cd7924d2409741bb4cb1eb3ba843bea7ec4a2.tar.gz
Drop git_patch_to_str
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.
Diffstat (limited to 'src/diff_print.c')
-rw-r--r--src/diff_print.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/diff_print.c b/src/diff_print.c
index 0ab21d033..dd31d1ffa 100644
--- a/src/diff_print.c
+++ b/src/diff_print.c
@@ -459,21 +459,3 @@ int git_patch_to_buf(
{
return git_patch_print(patch, diff_print_to_buffer_cb, out);
}
-
-/* print a git_patch to a char* */
-int git_patch_to_str(
- char **string,
- git_patch *patch)
-{
- int error;
- git_buf output = GIT_BUF_INIT;
-
- if (!(error = git_patch_to_buf(&output, patch)))
- *string = git_buf_detach(&output);
- else {
- git_buf_free(&output);
- *string = NULL;
- }
-
- return error;
-}