1 module deimos.git2.patch; 2 3 import deimos.git2.common; 4 import deimos.git2.types; 5 import deimos.git2.oid; 6 import deimos.git2.diff; 7 8 struct git_patch { 9 @disable this(); 10 @disable this(this); 11 } 12 13 int git_patch_from_diff( 14 git_patch **out_, git_diff *diff, size_t idx); 15 int git_patch_from_blobs( 16 git_patch **out_, 17 const(git_blob)* old_blob, 18 const(char)* old_as_path, 19 const(git_blob)* new_blob, 20 const(char)* new_as_path, 21 const(git_diff_options)* opts); 22 int git_patch_from_blob_and_buffer( 23 git_patch **out_, 24 const(git_blob)* old_blob, 25 const(char)* old_as_path, 26 const(char)* buffer, 27 size_t buffer_len, 28 const(char)* buffer_as_path, 29 const(git_diff_options)* opts); 30 void git_patch_free(git_patch *patch); 31 const(git_diff_delta)* git_patch_get_delta(git_patch *patch); 32 size_t git_patch_num_hunks(git_patch *patch); 33 int git_patch_line_stats( 34 size_t *total_context, 35 size_t *total_additions, 36 size_t *total_deletions, 37 const(git_patch)* patch); 38 int git_patch_get_hunk( 39 const(git_diff_hunk)** out_, 40 size_t *lines_in_hunk, 41 git_patch *patch, 42 size_t hunk_idx); 43 int git_patch_num_lines_in_hunk( 44 git_patch *patch, 45 size_t hunk_idx); 46 int git_patch_get_line_in_hunk( 47 const(git_diff_line)** out_, 48 git_patch *patch, 49 size_t hunk_idx, 50 size_t line_of_hunk); 51 size_t git_patch_size( 52 git_patch *patch, 53 int include_context, 54 int include_hunk_headers, 55 int include_file_headers); 56 int git_patch_print( 57 git_patch *patch, 58 git_diff_line_cb print_cb, 59 void *payload); 60 int git_patch_to_str( 61 char **string, 62 git_patch *patch);