diff --git a/lib/src/blame.dart b/lib/src/blame.dart index fddf426..3354218 100644 --- a/lib/src/blame.dart +++ b/lib/src/blame.dart @@ -83,7 +83,7 @@ class Blame with IterableMixin { /// /// Throws [RangeError] if index out of range. BlameHunk operator [](int index) { - return BlameHunk( + return BlameHunk._( bindings.getHunkByIndex( blamePointer: _blamePointer, index: index, @@ -96,7 +96,7 @@ class Blame with IterableMixin { /// /// Throws [RangeError] if [lineNumber] is out of range. BlameHunk forLine(int lineNumber) { - return BlameHunk( + return BlameHunk._( bindings.getHunkByLine( blamePointer: _blamePointer, lineNumber: lineNumber, @@ -123,7 +123,7 @@ final _finalizer = Finalizer>( class BlameHunk { /// Initializes a new instance of the [BlameHunk] class from /// provided pointer to blame hunk object in memory. - const BlameHunk(this._blameHunkPointer); + const BlameHunk._(this._blameHunkPointer); /// Pointer to memory address for allocated blame hunk object. final Pointer _blameHunkPointer; @@ -203,7 +203,7 @@ class _BlameIterator implements Iterator { if (index == count) { return false; } else { - currentHunk = BlameHunk( + currentHunk = BlameHunk._( bindings.getHunkByIndex( blamePointer: _blamePointer, index: index, diff --git a/lib/src/diff.dart b/lib/src/diff.dart index bc02316..4af064b 100644 --- a/lib/src/diff.dart +++ b/lib/src/diff.dart @@ -498,10 +498,10 @@ class DiffDelta { int get numberOfFiles => _diffDeltaPointer.ref.nfiles; /// Represents the "from" side of the diff. - DiffFile get oldFile => DiffFile(_diffDeltaPointer.ref.old_file); + DiffFile get oldFile => DiffFile._(_diffDeltaPointer.ref.old_file); /// Represents the "to" side of the diff. - DiffFile get newFile => DiffFile(_diffDeltaPointer.ref.new_file); + DiffFile get newFile => DiffFile._(_diffDeltaPointer.ref.new_file); @override String toString() { @@ -518,7 +518,7 @@ class DiffDelta { class DiffFile { /// Initializes a new instance of [DiffFile] class from provided diff file /// object. - const DiffFile(this._diffFile); + const DiffFile._(this._diffFile); final git_diff_file _diffFile; diff --git a/lib/src/odb.dart b/lib/src/odb.dart index a141e23..111bb58 100644 --- a/lib/src/odb.dart +++ b/lib/src/odb.dart @@ -60,7 +60,7 @@ class Odb { /// /// Throws a [LibGit2Error] if error occured. OdbObject read(Oid oid) { - return OdbObject( + return OdbObject._( bindings.read( odbPointer: _odbPointer, oidPointer: oid.pointer, @@ -108,7 +108,7 @@ final _finalizer = Finalizer>( class OdbObject { /// Initializes a new instance of the [OdbObject] class from /// provided pointer to odbObject object in memory. - OdbObject(this._odbObjectPointer) { + OdbObject._(this._odbObjectPointer) { _objectfinalizer.attach(this, _odbObjectPointer, detach: this); } diff --git a/lib/src/patch.dart b/lib/src/patch.dart index 7eb6e7a..5c28622 100644 --- a/lib/src/patch.dart +++ b/lib/src/patch.dart @@ -154,7 +154,7 @@ class Patch { PatchStats get stats { final result = bindings.lineStats(_patchPointer); - return PatchStats( + return PatchStats._( context: result['context']!, insertions: result['insertions']!, deletions: result['deletions']!, @@ -266,7 +266,7 @@ final _finalizer = Finalizer>( /// Line counts of each type in a patch. class PatchStats { - const PatchStats({ + const PatchStats._({ required this.context, required this.insertions, required this.deletions, diff --git a/lib/src/rebase.dart b/lib/src/rebase.dart index d917849..93650c4 100644 --- a/lib/src/rebase.dart +++ b/lib/src/rebase.dart @@ -55,7 +55,7 @@ class Rebase { rebase: _rebasePointer, index: i, ); - result.add(RebaseOperation(operation)); + result.add(RebaseOperation._(operation)); } return result; @@ -99,7 +99,7 @@ class Rebase { /// /// Throws a [LibGit2Error] if error occured. RebaseOperation next() { - return RebaseOperation(bindings.next(_rebasePointer)); + return RebaseOperation._(bindings.next(_rebasePointer)); } /// Commits the current patch. You must have resolved any conflicts that were @@ -151,7 +151,7 @@ final _finalizer = Finalizer>( class RebaseOperation { /// Initializes a new instance of the [RebaseOperation] class from /// provided pointer to rebase operation object in memory. - const RebaseOperation(this._rebaseOperationPointer); + const RebaseOperation._(this._rebaseOperationPointer); /// Pointer to memory address for allocated rebase operation object. final Pointer _rebaseOperationPointer; diff --git a/lib/src/reflog.dart b/lib/src/reflog.dart index d58dfbd..69a0561 100644 --- a/lib/src/reflog.dart +++ b/lib/src/reflog.dart @@ -46,7 +46,7 @@ class RefLog with IterableMixin { /// Requesting the reflog entry with an index of 0 will return the most /// recently created entry. RefLogEntry operator [](int index) { - return RefLogEntry( + return RefLogEntry._( bindings.getByIndex( reflogPointer: _reflogPointer, index: index, @@ -106,7 +106,7 @@ final _finalizer = Finalizer>( class RefLogEntry { /// Initializes a new instance of [RefLogEntry] class from provided /// pointer to RefLogEntry object in memory. - const RefLogEntry(this._entryPointer); + const RefLogEntry._(this._entryPointer); /// Pointer to memory address for allocated reflog entry object. final Pointer _entryPointer; @@ -149,7 +149,7 @@ class _RefLogIterator implements Iterator { if (_index == _count) { return false; } else { - _currentEntry = RefLogEntry( + _currentEntry = RefLogEntry._( bindings.getByIndex( reflogPointer: _reflogPointer, index: _index, diff --git a/lib/src/revparse.dart b/lib/src/revparse.dart index 713840f..5df8a63 100644 --- a/lib/src/revparse.dart +++ b/lib/src/revparse.dart @@ -75,7 +75,7 @@ class RevParse { /// /// Throws a [LibGit2Error] if error occured. static RevSpec range({required Repository repo, required String spec}) { - return RevSpec( + return RevSpec._( bindings.revParse( repoPointer: repo.pointer, spec: spec, @@ -92,7 +92,7 @@ class RevParse { class RevSpec { /// Initializes a new instance of [RevSpec] class from provided /// pointer to revspec object in memory. - const RevSpec(this._revSpecPointer); + const RevSpec._(this._revSpecPointer); /// Pointer to memory address for allocated revspec object. final Pointer _revSpecPointer;