Imported Upstream version 2.0.2
[platform/upstream/git.git] / builtin / fmt-merge-msg.c
index 3906eda..ef8b254 100644 (file)
@@ -230,12 +230,14 @@ static void add_branch_desc(struct strbuf *out, const char *name)
 static void record_person(int which, struct string_list *people,
                          struct commit *commit)
 {
+       const char *buffer;
        char *name_buf, *name, *name_end;
        struct string_list_item *elem;
        const char *field;
 
        field = (which == 'a') ? "\nauthor " : "\ncommitter ";
-       name = strstr(commit->buffer, field);
+       buffer = get_commit_buffer(commit, NULL);
+       name = strstr(buffer, field);
        if (!name)
                return;
        name += strlen(field);
@@ -247,6 +249,7 @@ static void record_person(int which, struct string_list *people,
        if (name_end < name)
                return;
        name_buf = xmemdupz(name, name_end - name + 1);
+       unuse_commit_buffer(commit, buffer);
 
        elem = string_list_lookup(people, name_buf);
        if (!elem) {