mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
feat(patch)!: divide Patch.create() into specific methods (#38)
BREAKING CHANGE: remove patch generation methods from Blob class
This commit is contained in:
parent
08cbe8a17f
commit
0844f03387
106 changed files with 156 additions and 6171 deletions
|
@ -1409,39 +1409,6 @@ class Repository {
|
|||
);
|
||||
}
|
||||
|
||||
/// Returns a [Patch] with changes between the blobs.
|
||||
///
|
||||
/// [a] is the blob for old side of diff.
|
||||
///
|
||||
/// [b] is the blob for new side of diff.
|
||||
///
|
||||
/// [aPath] treat [a] blob as if it had this filename, can be null.
|
||||
///
|
||||
/// [bPath] treat [b] blob as if it had this filename, can be null.
|
||||
///
|
||||
/// [flags] is a combination of [GitDiff] flags. Defaults to [GitDiff.normal].
|
||||
///
|
||||
/// [contextLines] is the number of unchanged lines that define the boundary
|
||||
/// of a hunk (and to display before and after). Defaults to 3.
|
||||
///
|
||||
/// [interhunkLines] is the maximum number of unchanged lines between hunk
|
||||
/// boundaries before the hunks will be merged into one. Defaults to 0.
|
||||
///
|
||||
/// **IMPORTANT**: Should be freed to release allocated memory.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Patch diffBlobs({
|
||||
required Blob a,
|
||||
required Blob b,
|
||||
String? aPath,
|
||||
String? bPath,
|
||||
Set<GitDiff> flags = const {GitDiff.normal},
|
||||
int contextLines = 3,
|
||||
int interhunkLines = 0,
|
||||
}) {
|
||||
return a.diff(newBlob: b, oldAsPath: aPath, newAsPath: bPath);
|
||||
}
|
||||
|
||||
/// Returns list of all the stashed states, first being the most recent.
|
||||
List<Stash> get stashes => Stash.list(this);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue