X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=commit.c;h=0094ec1c9278332f736d2814c847b272788a7dd3;hb=1e633418479926bc85ed21a4f91c845a3dd3ad66;hp=e9b07509678f5a4f61e5bedadea14b726e290ed1;hpb=745654f82a3ea02b15c59991d4461090a00b5645;p=git.git diff --git a/commit.c b/commit.c index e9b075096..0094ec1c9 100644 --- a/commit.c +++ b/commit.c @@ -315,6 +315,25 @@ int parse_commit(struct commit *item) return ret; } +int find_commit_subject(const char *commit_buffer, const char **subject) +{ + const char *eol; + const char *p = commit_buffer; + + while (*p && (*p != '\n' || p[1] != '\n')) + p++; + if (*p) { + p += 2; + for (eol = p; *eol && *eol != '\n'; eol++) + ; /* do nothing */ + } else + eol = p; + + *subject = p; + + return eol - p; +} + struct commit_list *commit_list_insert(struct commit *item, struct commit_list **list_p) { struct commit_list *new_list = xmalloc(sizeof(struct commit_list));