@@ -38,11 +38,20 @@ GIT_BEGIN_DECL
3838 */
3939GIT_EXTERN (int ) git_message_prettify (git_buf * out , const char * message , int strip_comments , char comment_char );
4040
41+ /**
42+ * Represents a single git message trailer.
43+ */
4144typedef struct {
4245 const char * key ;
4346 const char * value ;
4447} git_message_trailer ;
4548
49+ /**
50+ * Represents an array of git message trailers.
51+ *
52+ * Struct members under the private comment are private, subject to change
53+ * and should not be used by callers.
54+ */
4655typedef struct {
4756 git_message_trailer * trailers ;
4857 size_t count ;
@@ -52,20 +61,22 @@ typedef struct {
5261} git_message_trailer_array ;
5362
5463/**
55- * Parse trailers out of a message, calling a callback once for each trailer.
56- *
57- * Return non-zero from the callback to stop processing.
64+ * Parse trailers out of a message, filling the array pointed to by +arr+.
5865 *
5966 * Trailers are key/value pairs in the last paragraph of a message, not
6067 * including any patches or conflicts that may be present.
6168 *
6269 * @param arr A pre-allocated git_message_trailer_array struct to be filled in
6370 * with any trailers found during parsing.
6471 * @param message The message to be parsed
65- * @return 0 on success, or non-zero callback return value .
72+ * @return 0 on success, or non-zero on error .
6673 */
6774GIT_EXTERN (int ) git_message_trailers (git_message_trailer_array * arr , const char * message );
6875
76+ /**
77+ * Clean's up any allocated memory in the git_message_trailer_array filled by
78+ * a call to git_message_trailers.
79+ */
6980GIT_EXTERN (void ) git_message_trailer_array_free (git_message_trailer_array * arr );
7081
7182/** @} */
0 commit comments