Ggit.Patch – libgit2-glib-1.0 Reference Manual
Packages
libgit2-glib-1.0
Ggit
Patch
Patch.from_blobs
Patch.from_diff
@ref
get_delta
get_hunk
get_line_stats
get_num_hunks
get_num_lines_in_hunk
to_stream
to_string
unref
Patch
Object Hierarchy:
Description:
[
CCode
( ref_function =
"ggit_patch_ref"
, type_id =
"ggit_patch_get_type ()"
, unref_function =
"ggit_patch_unref"
) ]
[
Compact
]
public
class
Patch
Represents a patch object.
Namespace:
Ggit
Package:
libgit2-glib-1.0
Content:
Creation methods:
public
Patch.from_blobs
(
Blob
? old_blob,
string
? old_as_path,
Blob
? new_blob,
string
? new_as_path,
DiffOptions
? diff_options)
throws
Error
Directly generate a patch from the difference between two blobs.
public
Patch.from_diff
(
Diff
diff,
size_t
idx)
throws
Error
The
Patch
is a newly created object contains the text diffs for the delta.
Methods:
public
unowned
Patch
?
@ref
()
Atomically increments the reference count of
this
by one.
public
DiffDelta
?
get_delta
()
Get the diff delta corresponding to the patch.
public
DiffHunk
?
get_hunk
(
size_t
idx)
throws
Error
Get the
idx
'th hunk in the patch.
public
bool
get_line_stats
(
out
size_t
total_context,
out
size_t
total_additions,
out
size_t
total_deletions)
throws
Error
Get the line statistics of the patch.
public
size_t
get_num_hunks
()
Get the number of hunks in the patch.
public
int
get_num_lines_in_hunk
(
size_t
hunk)
Get the number of lines in
hunk
.
public
bool
to_stream
(
OutputStream
stream)
throws
Error
Write the contents of a patch to the provided stream.
public
string
?
to_string
()
throws
Error
Gets the content of a patch as a single diff text.
public
void
unref
()
Atomically decrements the reference count of
this
by one.