Diff is a representation of a git diff.
More...
#include <Diff.h>
|
|
using | PrintCB = std::function< int(const git_diff_delta &delta, const git_diff_hunk *hunk, const git_diff_line &line)> |
| | Callback for print()
|
| |
|
|
size_t | numDeltas () const noexcept |
| | Get count of deltas in this Diff.
|
| |
|
size_t | numDeltas (const git_delta_t &type) const noexcept |
| | Get count of deltas with the type (GIT_DELTA_ADDED, ...)
|
| |
|
const git_diff_delta * | getDelta (size_t idx) const noexcept |
| | Get a delta on the idx-th position.
|
| |
| bool | findSimilar (const git_diff_find_options *options=nullptr) const noexcept |
| | Find similar files in the Diff (in-place) More...
|
| |
|
bool | isSortedICase () const noexcept |
| | Return true if ignore-case-sorted.
|
| |
| int | forEach (const ForEachCB &forEachCB) const |
| | Invoke forEachCB callbacks for each file, hunk, ... in the diff. More...
|
| |
| int | print (git_diff_format_t format, const PrintCB &printCB) const |
| | Invoke forEachCB callbacks for each file, hunk, ... in the diff. More...
|
| |
|
std::optional< Buf > | toBuf (git_diff_format_t format) const noexcept |
| | Convert to Buf.
|
| |
|
GitTy * | diff () const noexcept |
| | Get the stored pointer to libgit2's git_diff.
|
| |
|
| operator GitTy * () const noexcept |
| | Alias for diff() – implicit conversion.
|
| |
Diff is a representation of a git diff.
◆ findSimilar()
| bool SlGit::Diff::findSimilar |
( |
const git_diff_find_options * |
options = nullptr | ) |
const |
|
inlinenoexcept |
Find similar files in the Diff (in-place)
- Parameters
-
| options | Options to use (like rename threshold) |
- Returns
- True on success.
◆ forEach()
| int SlGit::Diff::forEach |
( |
const ForEachCB & |
forEachCB | ) |
const |
Invoke forEachCB callbacks for each file, hunk, ... in the diff.
- Parameters
-
- Returns
- 0 on success, non-zero callback return value, or error code.
◆ print()
| int SlGit::Diff::print |
( |
git_diff_format_t |
format, |
|
|
const PrintCB & |
printCB |
|
) |
| const |
Invoke forEachCB callbacks for each file, hunk, ... in the diff.
- Parameters
-
| format | GIT_DIFF_FORMAT_PATCH, GIT_DIFF_FORMAT_PATCH_HEADER, ... |
| printCB | Callback |
- Returns
- 0 on success, non-zero callback return value, or error code.
The documentation for this class was generated from the following file:
- /home/abuild/rpmbuild/BUILD/slhelpers-20260428.f233ce9/include/git/Diff.h