@@ -62,7 +62,7 @@ diff_get_patch_byindex(git_diff_list* list, size_t idx)
6262 if (py_patch != NULL ) {
6363 py_patch -> old_file_path = delta -> old_file .path ;
6464 py_patch -> new_file_path = delta -> new_file .path ;
65- py_patch -> status = delta -> status ;
65+ py_patch -> status = git_diff_status_char ( delta -> status ) ;
6666 py_patch -> similarity = delta -> similarity ;
6767 py_patch -> old_oid = git_oid_allocfmt (& delta -> old_file .oid );
6868 py_patch -> new_oid = git_oid_allocfmt (& delta -> new_file .oid );
@@ -88,8 +88,8 @@ diff_get_patch_byindex(git_diff_list* list, size_t idx)
8888 PyList_SetItem (py_hunk -> lines , 0 ,
8989 to_unicode_n (header , header_len , NULL , NULL ));
9090 for (j = 1 ; j < lines_in_hunk + 1 ; ++ j ) {
91- err = git_diff_patch_get_line_in_hunk (NULL , & line ,
92- & line_len , NULL , NULL , patch , i , j - 1 );
91+ err = git_diff_patch_get_line_in_hunk (& py_hunk -> origin ,
92+ & line , & line_len , NULL , NULL , patch , i , j - 1 );
9393
9494 if (err < 0 )
9595 goto cleanup ;
@@ -126,7 +126,7 @@ PyMemberDef Patch_members[] = {
126126 MEMBER (Patch , new_file_path , T_STRING , "new file path" ),
127127 MEMBER (Patch , old_oid , T_STRING , "old oid" ),
128128 MEMBER (Patch , new_oid , T_STRING , "new oid" ),
129- MEMBER (Patch , status , T_INT , "status" ),
129+ MEMBER (Patch , status , T_CHAR , "status" ),
130130 MEMBER (Patch , similarity , T_INT , "similarity" ),
131131 MEMBER (Patch , hunks , T_OBJECT , "hunks" ),
132132 {NULL }
@@ -279,6 +279,7 @@ Hunk_dealloc(Hunk *self)
279279}
280280
281281PyMemberDef Hunk_members [] = {
282+ MEMBER (Hunk , origin , T_CHAR , "origin." ),
282283 MEMBER (Hunk , old_start , T_INT , "Old start." ),
283284 MEMBER (Hunk , old_lines , T_INT , "Old lines." ),
284285 MEMBER (Hunk , new_start , T_INT , "New start." ),
0 commit comments