mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
refactor: remove unnecessary git_libgit2_init()
This commit is contained in:
parent
b5561212e0
commit
b15b56f0ae
5 changed files with 9 additions and 14 deletions
|
@ -5,6 +5,7 @@ import 'bindings/patch.dart' as bindings;
|
|||
import 'blob.dart';
|
||||
import 'diff.dart';
|
||||
import 'git_types.dart';
|
||||
import 'util.dart';
|
||||
|
||||
class Patch {
|
||||
/// Initializes a new instance of [Patch] class from provided
|
||||
|
@ -30,6 +31,8 @@ class Patch {
|
|||
int contextLines = 3,
|
||||
int interhunkLines = 0,
|
||||
}) {
|
||||
libgit2.git_libgit2_init();
|
||||
|
||||
final int flagsInt =
|
||||
flags.fold(0, (previousValue, e) => previousValue | e.value);
|
||||
var result = <String, dynamic>{};
|
||||
|
@ -83,6 +86,8 @@ class Patch {
|
|||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Patch.fromDiff(Diff diff, int index) {
|
||||
libgit2.git_libgit2_init();
|
||||
|
||||
_patchPointer = bindings.fromDiff(diff.pointer, index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue