mirror of
https://git.proxmox.com/git/libgit2
synced 2026-08-26 18:40:39 +00:00
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.
This commit is contained in:
+5
-12
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user