@@ -223,16 +223,14 @@ static void add_branch_desc(struct strbuf *out, const char *name)
223
223
224
224
#define util_as_integral (elem ) ((intptr_t)((elem)->util))
225
225
226
- static void record_person (int which , struct string_list * people ,
227
- struct commit * commit )
226
+ static void record_person_from_buf (int which , struct string_list * people ,
227
+ const char * buffer )
228
228
{
229
- const char * buffer ;
230
229
char * name_buf , * name , * name_end ;
231
230
struct string_list_item * elem ;
232
231
const char * field ;
233
232
234
233
field = (which == 'a' ) ? "\nauthor " : "\ncommitter " ;
235
- buffer = get_commit_buffer (commit , NULL );
236
234
name = strstr (buffer , field );
237
235
if (!name )
238
236
return ;
@@ -245,7 +243,6 @@ static void record_person(int which, struct string_list *people,
245
243
if (name_end < name )
246
244
return ;
247
245
name_buf = xmemdupz (name , name_end - name + 1 );
248
- unuse_commit_buffer (commit , buffer );
249
246
250
247
elem = string_list_lookup (people , name_buf );
251
248
if (!elem ) {
@@ -256,6 +253,15 @@ static void record_person(int which, struct string_list *people,
256
253
free (name_buf );
257
254
}
258
255
256
+
257
+ static void record_person (int which , struct string_list * people ,
258
+ struct commit * commit )
259
+ {
260
+ const char * buffer = get_commit_buffer (commit , NULL );
261
+ record_person_from_buf (which , people , buffer );
262
+ unuse_commit_buffer (commit , buffer );
263
+ }
264
+
259
265
static int cmp_string_list_util_as_integral (const void * a_ , const void * b_ )
260
266
{
261
267
const struct string_list_item * a = a_ , * b = b_ ;
0 commit comments