File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -357,9 +357,10 @@ static int patch_print_header_cb(
357
357
358
358
if (line -> origin == GIT_DIFF_LINE_FILE_HDR ) {
359
359
rb_ary_push (rb_buffer , rb_str_new (line -> content , line -> content_len ));
360
+ return GIT_OK ;
361
+ } else {
362
+ return GIT_ITEROVER ;
360
363
}
361
-
362
- return GIT_OK ;
363
364
}
364
365
365
366
/*
@@ -388,10 +389,13 @@ static VALUE rb_git_diff_patch_to_s(VALUE self)
388
389
static VALUE rb_git_diff_patch_header (VALUE self )
389
390
{
390
391
git_patch * patch ;
392
+ int error = 0 ;
391
393
VALUE rb_buffer = rb_ary_new ();
392
394
Data_Get_Struct (self , git_patch , patch );
393
395
394
- rugged_exception_check (git_patch_print (patch , patch_print_header_cb , (void * )rb_buffer ));
396
+ error = git_patch_print (patch , patch_print_header_cb , (void * )rb_buffer );
397
+ if (error && error != GIT_ITEROVER )
398
+ rugged_exception_check (error );
395
399
396
400
return rb_ary_join (rb_buffer , Qnil );
397
401
}
You can’t perform that action at this time.
0 commit comments