Top | ![]() |
![]() |
![]() |
![]() |
GgitDiffDelta *
ggit_patch_get_delta (GgitPatch *patch
);
Get the diff delta corresponding to the patch.
GgitDiffHunk * ggit_patch_get_hunk (GgitPatch *patch
,gsize idx
,GError **error
);
Get the idx
'th hunk in the patch.
gboolean ggit_patch_get_line_stats (GgitPatch *patch
,gsize *total_context
,gsize *total_additions
,gsize *total_deletions
,GError **error
);
Get the line statistics of the patch.
gsize
ggit_patch_get_num_hunks (GgitPatch *patch
);
Get the number of hunks in the patch.
gint ggit_patch_get_num_lines_in_hunk (GgitPatch *patch
,gsize hunk
);
Get the number of lines in hunk
.
GgitPatch * ggit_patch_new_from_blobs (GgitBlob *old_blob
,const gchar *old_as_path
,GgitBlob *new_blob
,const gchar *new_as_path
,GgitDiffOptions *diff_options
,GError **error
);
Directly generate a patch from the difference between two blobs.
This is just like ggit_diff_blobs()
except it generates a patch object
for the difference instead of directly making callbacks. You can use the
standard ggit_patch accessor functions to read the patch data, and
you must call ggit_patch_unref on the patch when done.
old_blob |
a GgitBlob to diff from. |
[allow-none] |
old_as_path |
treat |
[allow-none] |
new_blob |
a GgitBlob to diff to. |
[allow-none] |
new_as_path |
treat |
[allow-none] |
diff_options |
a GgitDiffOptions, or |
[allow-none] |
error |
GgitPatch * ggit_patch_new_from_diff (GgitDiff *diff
,gsize idx
,GError **error
);
The GgitPatch is a newly created object contains the text diffs
for the delta. You have to call ggit_patch_unref()
when you are
done with it. You can use the patch object to loop over all the hunks
and lines in the diff of the one delta.
GgitPatch *
ggit_patch_ref (GgitPatch *patch
);
Atomically increments the reference count of patch
by one.
This function is MT-safe and may be called from any thread.
gboolean ggit_patch_to_stream (GgitPatch *patch
,GOutputStream *stream
,GError **error
);
Write the contents of a patch to the provided stream.
gchar * ggit_patch_to_string (GgitPatch *patch
,GError **error
);
Gets the content of a patch as a single diff text.