summaryrefslogtreecommitdiff
path: root/include/git2/message.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-01-26 16:32:49 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-01-27 04:44:06 +0100
commite1d7f0035e8683423271f1f63b57fd9c663e4fb0 (patch)
tree80f5c8ac3b81d6022d5a2511bfd7c2d7894649fd /include/git2/message.h
parentee550477d1c22273d6d9701b444041ff101144ec (diff)
downloadlibgit2-e1d7f0035e8683423271f1f63b57fd9c663e4fb0.tar.gz
messsage: use git_buf in prettify()
A lot of the tests were checking for overflow, which we don't have anymore, so we can remove them.
Diffstat (limited to 'include/git2/message.h')
-rw-r--r--include/git2/message.h17
1 files changed, 5 insertions, 12 deletions
diff --git a/include/git2/message.h b/include/git2/message.h
index 395c88690..bcdb72f6a 100644
--- a/include/git2/message.h
+++ b/include/git2/message.h
@@ -8,6 +8,7 @@
#define INCLUDE_git_message_h__
#include "common.h"
+#include "buffer.h"
/**
* @file git2/message.h
@@ -23,25 +24,17 @@ GIT_BEGIN_DECL
*
* Optionally, can remove lines starting with a "#".
*
- * @param out The user-allocated buffer which will be filled with the
- * cleaned up message. Pass NULL if you just want to get the needed
- * size of the prettified message as the output value.
- *
- * @param out_size Size of the `out` buffer in bytes.
+ * @param out The user-allocated git_buf which will be filled with the
+ * cleaned up message.
*
* @param message The message to be prettified.
*
* @param strip_comments Non-zero to remove lines starting with "#", 0 to
* leave them in.
*
- * @return -1 on error, else number of characters in prettified message
- * including the trailing NUL byte
+ * @return 0 or an error code.
*/
-GIT_EXTERN(int) git_message_prettify(
- char *out,
- size_t out_size,
- const char *message,
- int strip_comments);
+GIT_EXTERN(int) git_message_prettify(git_buf *out, const char *message, int strip_comments);
/** @} */
GIT_END_DECL