mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
refactor: remove unnecessary git_libgit2_init()
This commit is contained in:
parent
ce9384cac9
commit
6bd04bb09d
5 changed files with 1 additions and 8 deletions
|
@ -23,7 +23,6 @@ class Commit {
|
|||
///
|
||||
/// Should be freed with `free()` to release allocated memory.
|
||||
Commit.lookup(Repository repo, Oid oid) {
|
||||
libgit2.git_libgit2_init();
|
||||
_commitPointer = bindings.lookup(repo.pointer, oid.pointer);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ class Oid {
|
|||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Oid.fromSHA(Repository repository, String sha) {
|
||||
libgit2.git_libgit2_init();
|
||||
if (sha.length == 40) {
|
||||
_oidPointer = bindings.fromSHA(sha);
|
||||
} else {
|
||||
|
|
|
@ -38,9 +38,7 @@ class References {
|
|||
class Reference {
|
||||
/// Initializes a new instance of the [Reference] class.
|
||||
/// Should be freed with `free()` to release allocated memory.
|
||||
Reference(this._repoPointer, this._refPointer) {
|
||||
libgit2.git_libgit2_init();
|
||||
}
|
||||
Reference(this._repoPointer, this._refPointer);
|
||||
|
||||
/// Initializes a new instance of the [Reference] class by creating a new direct reference.
|
||||
///
|
||||
|
|
|
@ -5,13 +5,11 @@ import 'commit.dart';
|
|||
import 'oid.dart';
|
||||
import 'repository.dart';
|
||||
import 'enums.dart';
|
||||
import 'util.dart';
|
||||
|
||||
class RevWalk {
|
||||
/// Initializes a new instance of the [RevWalk] class.
|
||||
/// Should be freed with `free()` to release allocated memory.
|
||||
RevWalk(Repository repo) {
|
||||
libgit2.git_libgit2_init();
|
||||
_revWalkPointer = bindings.create(repo.pointer);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ class Tree {
|
|||
///
|
||||
/// Should be freed with `free()` to release allocated memory.
|
||||
Tree.lookup(Repository repo, Oid id) {
|
||||
libgit2.git_libgit2_init();
|
||||
_treePointer = bindings.lookup(repo.pointer, id.pointer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue