diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index e0fe910..3ee7f16 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v3.0.1 - uses: subosito/flutter-action@v2 with: - channel: stable + channel: master - name: Install dependencies run: flutter pub get @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@v3.0.1 - uses: subosito/flutter-action@v2 with: - channel: stable + channel: master - name: Install dependencies run: flutter pub get diff --git a/CHANGELOG.md b/CHANGELOG.md index 8479242..ef4ae72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,61 +1,3 @@ -## 1.2.2 - -- fix: lookup package in correct location of Dart/Flutter cached packages - -## 1.2.1 - -- fix: use default location of Flutter's '.pub_cache' folder - -- docs: update README with troubleshooting instructions for Windows - -- chore: bump minimum dart and flutter versions - -- chore: Lookup library in system path (thanks @dnys1) - -## 1.2.0 - -- feat: upgrade libgit2 to 1.5.0 - -- feat: add ability to pass checkout options to `reset(...)` API method - -- feat: add ability to pass options to `prune(...)` Worktree API method - -- feat: add ability to pass options to `Merge.fileFromIndex(...)` API method - -- feat: add ability to pass options to `addAll(...)` Index API method - -- feat: add ability to pass options to `revert(...)` and `revertTo(...)` Commit API methods: - - - select parent to revert to for merge commits - - merge options - - checkout options - -- chore: upgrade dependencies - -## 1.1.2 - -- fix: lookup library in Flutter's .pub_cache folder - -- feat: add ability to limit number of commits to walk in revision walk - -## 1.1.1 - -- fix: lookup library in correct locations - -- feat: add ability to pass optional notes location to `Note.list(...)` method - -## 1.1.0 - -- feat: add ability to get and set libgit2 global options - -- feat: upgrade Flutter version constraints to `>=3.0.0` - -- feat: add ability to remove entries in index with `resetDefault(...)` method - -- feat: add ability to compare objects (value based equality) - - Note: comparison of Repository objects have naive implementation. Comparison is based on repository path, and previously loaded into memory index, odb, etc. might be different. Use with caution. - ## 1.0.0 - Initial release. diff --git a/README.md b/README.md index e1c6679..575e785 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # libgit2dart +![Coverage](coverage_badge.svg) + **Dart bindings to libgit2** libgit2dart package provides ability to use [libgit2](https://github.com/libgit2/libgit2) in Dart/Flutter. @@ -47,13 +49,13 @@ print(Libgit2.version); **Note**: The following steps only required if you are using package in Dart application (Flutter application will have libgit2 library bundled automatically when you build for release). -After adding the package as dependency you should run: +After compiling the application you should run: ```shell dart run libgit2dart:setup ``` -That'll copy the prebuilt libgit2 library for your platform into `.dart_tool/libgit2//` which you'll need to add to the same folder as your executable after compilation. +That'll copy the prebuilt libgit2 library for your platform into `.dart_tool/libgit2//` which you'll need to add to the same folder as your executable. If you upgrade the version of libgit2dart package in your dependencies you should run the following commands to have the latest libgit2 library for your platform to provide with your application: @@ -663,8 +665,6 @@ Fork libgit2dart, improve libgit2dart, send a pull request. ### Troubleshooting -#### Linux: - If you are developing on Linux using non-Debian based distrib you might encounter these errors: - Failed to load dynamic library: libpcre.so.3: cannot open shared object file: No such file or directory @@ -679,16 +679,6 @@ sudo ln -s /usr/lib64/libpcre.so /usr/lib64/libpcre.so.3 sudo ln -s /usr/lib64/libpcreposix.so /usr/lib64/libpcreposix.so.3 ``` -#### Windows: - -If you are developing on Windows you might encounter: - -- Failed to load dynamic library: error code 126 - -That happens because libgit2 dynamic library bundled with libgit2dart package is precompiled with ssh support, and it fails to find the `libssh2.dll`. - -To fix that error you should [build](https://github.com/libssh2/libssh2/blob/master/docs/INSTALL_CMAKE.md) libssh2, and place resulting `libssh2.dll` somewhere in system path (e.g. "Windows\System32"). - ### Ffigen To generate bindings with ffigen use (adjust paths to yours): @@ -703,6 +693,7 @@ To run all tests and generate coverage report make sure to have activated packag ```sh $ dart pub global activate coverage +$ dart pub global activate flutter_coverage_badge ``` And run: diff --git a/analysis_options.yaml b/analysis_options.yaml index fe612a1..f9d5ecc 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -4,11 +4,9 @@ analyzer: language: strict-casts: true strict-raw-types: true - strict-inference: true exclude: - lib/src/bindings/libgit2_bindings.dart - - lib/src/bindings/libgit2_opts_bindings.dart linter: rules: diff --git a/bin/setup.dart b/bin/setup.dart index 74bce74..013c3ef 100644 --- a/bin/setup.dart +++ b/bin/setup.dart @@ -1,45 +1,48 @@ import 'dart:io'; import 'package:args/command_runner.dart'; +import 'package:cli_util/cli_logging.dart' show Ansi, Logger; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/libgit2.dart'; import 'package:libgit2dart/src/util.dart'; import 'package:path/path.dart' as path; +import 'package:pub_cache/pub_cache.dart'; /// Copies prebuilt libgit2 library from package in '.pub_cache' into correct /// directory for [platform]. Future copyLibrary(String platform) async { + final logger = Logger.standard(); + final ansi = Ansi(Ansi.terminalSupportsAnsi); + if (File(path.join(Directory.current.path, libDir, platform, getLibName())) .existsSync()) { if (libgit2Version == Libgit2.version) { - stdout.writeln('libgit2 for $platform is already available.'); + logger.stdout('${ansi.green}libgit2 for $platform is already available.'); } else { - stdout.writeln( - 'libgit2 for $platform is outdated.\n' + logger.stdout( + '${ansi.red}libgit2 for $platform is outdated.\n' 'Please run following commands: \n' 'dart run libgit2dart:setup clean\n' 'dart run libgit2dart:setup\n\n', ); } } else { - final libPath = checkCache(); + final pubCache = PubCache(); + final pubCacheDir = + pubCache.getLatestVersion('libgit2dart')!.resolve()!.location; final libName = getLibName(); - stdout.writeln('Copying libgit2 for $platform'); - if (libPath == null) { - stdout.writeln( - "Couldn't find libgit2dart package.\n" - "Make sure to run 'dart pub get' to resolve dependencies.", - ); - } else { - final destination = path.join(libDir, platform); - Directory(destination).createSync(recursive: true); - File(path.join(libPath, platform, libName)).copySync( - path.join(destination, libName), - ); + logger.stdout('Copying libgit2 for $platform'); + final destination = path.join(libDir, platform); + Directory(destination).createSync(recursive: true); + File(path.join(pubCacheDir.path, platform, libName)).copySync( + path.join(destination, libName), + ); - stdout.writeln('Done! libgit2 for $platform is now available!'); - } + logger.stdout( + '${ansi.green}Done! libgit2 for $platform is now available!' + '${ansi.none}', + ); } } @@ -52,10 +55,9 @@ class CleanCommand extends Command { @override void run() { - stdout.writeln('Cleaning...'); - if (Directory(libDir).existsSync()) { - Directory(libDir).deleteSync(recursive: true); - } + final logger = Logger.standard(); + logger.stdout('Cleaning...'); + Directory(libDir).deleteSync(recursive: true); } } diff --git a/coverage.sh b/coverage.sh index 1ea3ef2..8b87ed6 100755 --- a/coverage.sh +++ b/coverage.sh @@ -1,2 +1,2 @@ #!/bin/bash -dart test --coverage=coverage --test-randomize-ordering-seed random && dart pub global run coverage:format_coverage --lcov --check-ignore --in=coverage --out=coverage/lcov.info --report-on=lib && genhtml coverage/lcov.info -o coverage/ \ No newline at end of file +dart test --coverage="coverage" --test-randomize-ordering-seed random && format_coverage --lcov --check-ignore --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib && genhtml coverage/lcov.info -o coverage/ && dart pub global run flutter_coverage_badge \ No newline at end of file diff --git a/coverage_badge.svg b/coverage_badge.svg new file mode 100644 index 0000000..0c4efc0 --- /dev/null +++ b/coverage_badge.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + coverage + coverage + 100% + 100% + + diff --git a/lib/src/annotated.dart b/lib/src/annotated.dart index 0c4669e..06030e2 100644 --- a/lib/src/annotated.dart +++ b/lib/src/annotated.dart @@ -1,13 +1,10 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/annotated.dart' as bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:meta/meta.dart'; -@immutable -class AnnotatedCommit extends Equatable { +class AnnotatedCommit { /// Lookups an annotated commit from the given commit [oid]. /// /// It is preferable to use [AnnotatedCommit.fromReference] instead of this @@ -84,7 +81,6 @@ class AnnotatedCommit extends Equatable { /// Pointer to pointer to memory address for allocated commit object. /// /// Note: For internal use. - @internal Pointer get pointer => _annotatedCommitPointer; /// Commit oid that the given annotated commit refers to. @@ -100,9 +96,6 @@ class AnnotatedCommit extends Equatable { bindings.free(_annotatedCommitPointer); _finalizer.detach(this); } - - @override - List get props => [oid]; } // coverage:ignore-start diff --git a/lib/src/bindings/annotated.dart b/lib/src/bindings/annotated.dart index 74176af..fe32788 100644 --- a/lib/src/bindings/annotated.dart +++ b/lib/src/bindings/annotated.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Creates an annotated commit from the given commit id. The returned @@ -77,7 +76,7 @@ Pointer fromRevSpec({ required String revspec, }) { final out = calloc>(); - final revspecC = revspec.toChar(); + final revspecC = revspec.toNativeUtf8().cast(); final error = libgit2.git_annotated_commit_from_revspec( out, repoPointer, @@ -107,8 +106,8 @@ Pointer fromFetchHead({ required Pointer oid, }) { final out = calloc>(); - final branchNameC = branchName.toChar(); - final remoteUrlC = remoteUrl.toChar(); + final branchNameC = branchName.toNativeUtf8().cast(); + final remoteUrlC = remoteUrl.toNativeUtf8().cast(); final error = libgit2.git_annotated_commit_from_fetchhead( out, repoPointer, @@ -137,7 +136,7 @@ Pointer oid(Pointer commit) => /// Get the refname that the given annotated commit refers to. String refName(Pointer commit) { final result = libgit2.git_annotated_commit_ref(commit); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Frees an annotated commit. diff --git a/lib/src/bindings/attr.dart b/lib/src/bindings/attr.dart index 1a40993..363c304 100644 --- a/lib/src/bindings/attr.dart +++ b/lib/src/bindings/attr.dart @@ -1,7 +1,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Look up the value of one git attribute for path. @@ -15,9 +14,9 @@ Object? getAttribute({ required String path, required String name, }) { - final out = calloc>(); - final pathC = path.toChar(); - final nameC = name.toChar(); + final out = calloc>(); + final pathC = path.toNativeUtf8().cast(); + final nameC = name.toNativeUtf8().cast(); libgit2.git_attr_get(out, repoPointer, flags, pathC, nameC); final result = out.value; @@ -38,7 +37,7 @@ Object? getAttribute({ return false; } if (attributeValue == git_attr_value_t.GIT_ATTR_VALUE_STRING) { - return result.toDartString(); + return result.cast().toDartString(); } return null; } diff --git a/lib/src/bindings/blame.dart b/lib/src/bindings/blame.dart index 7bdab62..bf7bfd9 100644 --- a/lib/src/bindings/blame.dart +++ b/lib/src/bindings/blame.dart @@ -2,7 +2,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/oid.dart'; import 'package:libgit2dart/src/util.dart'; @@ -21,7 +20,7 @@ Pointer file({ int? maxLine, }) { final out = calloc>(); - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final options = calloc(); libgit2.git_blame_options_init(options, GIT_BLAME_OPTIONS_VERSION); @@ -78,7 +77,7 @@ Pointer buffer({ required String buffer, }) { final out = calloc>(); - final bufferC = buffer.toChar(); + final bufferC = buffer.toNativeUtf8().cast(); final error = libgit2.git_blame_buffer( out, reference, diff --git a/lib/src/bindings/blob.dart b/lib/src/bindings/blob.dart index 13ed1e5..fb2c0d5 100644 --- a/lib/src/bindings/blob.dart +++ b/lib/src/bindings/blob.dart @@ -4,7 +4,6 @@ import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Lookup a blob object from a repository. The returned blob must be freed @@ -85,7 +84,7 @@ Pointer createFromWorkdir({ required String relativePath, }) { final out = calloc(); - final relativePathC = relativePath.toChar(); + final relativePathC = relativePath.toNativeUtf8().cast(); final error = libgit2.git_blob_create_from_workdir( out, repoPointer, @@ -111,7 +110,7 @@ Pointer createFromDisk({ required String path, }) { final out = calloc(); - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final error = libgit2.git_blob_create_from_disk(out, repoPointer, pathC); calloc.free(pathC); @@ -151,7 +150,7 @@ String filterContent({ git_oid? attributesCommit, }) { final out = calloc(); - final asPathC = asPath.toChar(); + final asPathC = asPath.toNativeUtf8().cast(); final opts = calloc(); libgit2.git_blob_filter_options_init(opts, GIT_BLOB_FILTER_OPTIONS_VERSION); opts.ref.flags = flags; @@ -163,7 +162,7 @@ String filterContent({ late final String result; if (out.ref.ptr != nullptr) { - result = out.ref.ptr.toDartString(length: out.ref.size); + result = out.ref.ptr.cast().toDartString(length: out.ref.size); } libgit2.git_buf_dispose(out); diff --git a/lib/src/bindings/branch.dart b/lib/src/bindings/branch.dart index d1738c2..675dd53 100644 --- a/lib/src/bindings/branch.dart +++ b/lib/src/bindings/branch.dart @@ -5,7 +5,6 @@ import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/reference.dart' as reference_bindings; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Return a list of branches. The returned references must be freed with @@ -61,7 +60,7 @@ Pointer lookup({ required int branchType, }) { final out = calloc>(); - final branchNameC = branchName.toChar(); + final branchNameC = branchName.toNativeUtf8().cast(); final error = libgit2.git_branch_lookup( out, repoPointer, @@ -98,7 +97,7 @@ Pointer create({ required bool force, }) { final out = calloc>(); - final branchNameC = branchName.toChar(); + final branchNameC = branchName.toNativeUtf8().cast(); final forceC = force ? 1 : 0; final error = libgit2.git_branch_create( out, @@ -148,7 +147,7 @@ void rename({ required bool force, }) { final out = calloc>(); - final newBranchNameC = newBranchName.toChar(); + final newBranchNameC = newBranchName.toNativeUtf8().cast(); final forceC = force ? 1 : 0; final error = libgit2.git_branch_move( out, @@ -203,7 +202,7 @@ bool isCheckedOut(Pointer branch) { /// /// Throws a [LibGit2Error] if error occured. String name(Pointer ref) { - final out = calloc>(); + final out = calloc>(); final error = libgit2.git_branch_name(out, ref); final result = out.value; @@ -213,7 +212,7 @@ String name(Pointer ref) { if (error < 0) { throw LibGit2Error(libgit2.git_error_last()); } else { - return result.toDartString(); + return result.cast().toDartString(); } } @@ -230,10 +229,10 @@ String remoteName({ required String branchName, }) { final out = calloc(); - final branchNameC = branchName.toChar(); + final branchNameC = branchName.toNativeUtf8().cast(); final error = libgit2.git_branch_remote_name(out, repoPointer, branchNameC); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -282,7 +281,7 @@ void setUpstream({ required Pointer branchPointer, required String? branchName, }) { - final branchNameC = branchName?.toChar() ?? nullptr; + final branchNameC = branchName?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_branch_set_upstream(branchPointer, branchNameC); calloc.free(branchNameC); @@ -304,10 +303,10 @@ String upstreamName({ required String branchName, }) { final out = calloc(); - final branchNameC = branchName.toChar(); + final branchNameC = branchName.toNativeUtf8().cast(); final error = libgit2.git_branch_upstream_name(out, repoPointer, branchNameC); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -331,14 +330,14 @@ String upstreamRemote({ required String branchName, }) { final out = calloc(); - final branchNameC = branchName.toChar(); + final branchNameC = branchName.toNativeUtf8().cast(); final error = libgit2.git_branch_upstream_remote( out, repoPointer, branchNameC, ); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -362,14 +361,14 @@ String upstreamMerge({ required String branchName, }) { final out = calloc(); - final branchNameC = branchName.toChar(); + final branchNameC = branchName.toNativeUtf8().cast(); final error = libgit2.git_branch_upstream_merge( out, repoPointer, branchNameC, ); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); diff --git a/lib/src/bindings/checkout.dart b/lib/src/bindings/checkout.dart index ec139be..e3849d2 100644 --- a/lib/src/bindings/checkout.dart +++ b/lib/src/bindings/checkout.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Updates files in the index and the working tree to match the content of the @@ -128,13 +127,13 @@ List initOptions({ optsC.ref.checkout_strategy = strategy; if (directory != null) { - optsC.ref.target_directory = directory.toChar(); + optsC.ref.target_directory = directory.toNativeUtf8().cast(); } - var pathPointers = >[]; - Pointer> strArray = nullptr; + var pathPointers = >[]; + Pointer> strArray = nullptr; if (paths != null) { - pathPointers = paths.map((e) => e.toChar()).toList(); + pathPointers = paths.map((e) => e.toNativeUtf8().cast()).toList(); strArray = calloc(paths.length); for (var i = 0; i < paths.length; i++) { strArray[i] = pathPointers[i]; diff --git a/lib/src/bindings/commit.dart b/lib/src/bindings/commit.dart index 70a66ac..55465c0 100644 --- a/lib/src/bindings/commit.dart +++ b/lib/src/bindings/commit.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Lookup a commit object from a repository. The returned commit must be @@ -46,9 +45,10 @@ Pointer create({ required List> parents, }) { final out = calloc(); - final updateRefC = updateRef.toChar(); - final messageEncodingC = messageEncoding?.toChar() ?? nullptr; - final messageC = message.toChar(); + final updateRefC = updateRef.toNativeUtf8().cast(); + final messageEncodingC = + messageEncoding?.toNativeUtf8().cast() ?? nullptr; + final messageC = message.toNativeUtf8().cast(); final parentsC = calloc>(parentCount); if (parents.isNotEmpty) { @@ -103,9 +103,10 @@ String createBuffer({ required List> parents, }) { final out = calloc(); - final updateRefC = updateRef.toChar(); - final messageEncodingC = messageEncoding?.toChar() ?? nullptr; - final messageC = message.toChar(); + final updateRefC = updateRef.toNativeUtf8().cast(); + final messageEncodingC = + messageEncoding?.toNativeUtf8().cast() ?? nullptr; + final messageC = message.toNativeUtf8().cast(); final parentsC = calloc>(parentCount); if (parents.isNotEmpty) { @@ -128,7 +129,7 @@ String createBuffer({ parentsC, ); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -168,9 +169,10 @@ Pointer amend({ required Pointer? treePointer, }) { final out = calloc(); - final updateRefC = updateRef?.toChar() ?? nullptr; - final messageEncodingC = messageEncoding?.toChar() ?? nullptr; - final messageC = message?.toChar() ?? nullptr; + final updateRefC = updateRef?.toNativeUtf8().cast() ?? nullptr; + final messageEncodingC = + messageEncoding?.toNativeUtf8().cast() ?? nullptr; + final messageC = message?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_commit_amend( out, @@ -214,7 +216,7 @@ Pointer duplicate(Pointer source) { /// If the encoding header in the commit is missing UTF-8 is assumed. String messageEncoding(Pointer commit) { final result = libgit2.git_commit_message_encoding(commit); - return result == nullptr ? 'utf-8' : result.toDartString(); + return result == nullptr ? 'utf-8' : result.cast().toDartString(); } /// Get the full message of a commit. @@ -222,7 +224,7 @@ String messageEncoding(Pointer commit) { /// The returned message will be slightly prettified by removing any potential /// leading newlines. String message(Pointer commit) { - return libgit2.git_commit_message(commit).toDartString(); + return libgit2.git_commit_message(commit).cast().toDartString(); } /// Get the short "summary" of the git commit message. @@ -237,7 +239,7 @@ String summary(Pointer commit) { if (result == nullptr) { throw LibGit2Error(libgit2.git_error_last()); } else { - return result.toDartString(); + return result.cast().toDartString(); } } @@ -248,7 +250,7 @@ String summary(Pointer commit) { /// trimmed. String body(Pointer commit) { final result = libgit2.git_commit_body(commit); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Get an arbitrary header field. @@ -259,10 +261,10 @@ String headerField({ required String field, }) { final out = calloc(); - final fieldC = field.toChar(); + final fieldC = field.toNativeUtf8().cast(); final error = libgit2.git_commit_header_field(out, commitPointer, fieldC); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -384,48 +386,8 @@ Pointer tree(Pointer commit) { void revert({ required Pointer repoPointer, required Pointer commitPointer, - required int mainline, - int? mergeFavor, - int? mergeFlags, - int? mergeFileFlags, - int? checkoutStrategy, - String? checkoutDirectory, - List? checkoutPaths, }) { - final opts = calloc(); - libgit2.git_revert_options_init(opts, GIT_REVERT_OPTIONS_VERSION); - - opts.ref.mainline = mainline; - - if (mergeFavor != null) opts.ref.merge_opts.file_favor = mergeFavor; - if (mergeFlags != null) opts.ref.merge_opts.flags = mergeFlags; - if (mergeFileFlags != null) opts.ref.merge_opts.file_flags = mergeFileFlags; - - if (checkoutStrategy != null) { - opts.ref.checkout_opts.checkout_strategy = checkoutStrategy; - } - if (checkoutDirectory != null) { - opts.ref.checkout_opts.target_directory = checkoutDirectory.toChar(); - } - var pathPointers = >[]; - Pointer> strArray = nullptr; - if (checkoutPaths != null) { - pathPointers = checkoutPaths.map((e) => e.toChar()).toList(); - strArray = calloc(checkoutPaths.length); - for (var i = 0; i < checkoutPaths.length; i++) { - strArray[i] = pathPointers[i]; - } - opts.ref.checkout_opts.paths.strings = strArray; - opts.ref.checkout_opts.paths.count = checkoutPaths.length; - } - - final error = libgit2.git_revert(repoPointer, commitPointer, opts); - - for (final p in pathPointers) { - calloc.free(p); - } - calloc.free(strArray); - calloc.free(opts); + final error = libgit2.git_revert(repoPointer, commitPointer, nullptr); if (error < 0) { throw LibGit2Error(libgit2.git_error_last()); @@ -443,18 +405,11 @@ Pointer revertCommit({ required Pointer revertCommitPointer, required Pointer ourCommitPointer, required int mainline, - int? mergeFavor, - int? mergeFlags, - int? mergeFileFlags, }) { final out = calloc>(); final opts = calloc(); libgit2.git_merge_options_init(opts, GIT_MERGE_OPTIONS_VERSION); - if (mergeFavor != null) opts.ref.file_favor = mergeFavor; - if (mergeFlags != null) opts.ref.flags = mergeFlags; - if (mergeFileFlags != null) opts.ref.file_flags = mergeFileFlags; - final error = libgit2.git_revert_commit( out, repoPointer, diff --git a/lib/src/bindings/config.dart b/lib/src/bindings/config.dart index 813cd4c..f937955 100644 --- a/lib/src/bindings/config.dart +++ b/lib/src/bindings/config.dart @@ -5,14 +5,13 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Create a new config instance containing a single on-disk file. The returned /// config must be freed with [free]. Pointer open(String path) { final out = calloc>(); - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); libgit2.git_config_open_ondisk(out, pathC); calloc.free(pathC); @@ -60,7 +59,7 @@ String findGlobal() { final out = calloc(); final error = libgit2.git_config_find_global(out); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -82,7 +81,7 @@ String findSystem() { final out = calloc(); final error = libgit2.git_config_find_system(out); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -108,7 +107,7 @@ String findXdg() { final out = calloc(); final error = libgit2.git_config_find_xdg(out); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -146,7 +145,7 @@ Pointer getEntry({ required String variable, }) { final out = calloc>(); - final nameC = variable.toChar(); + final nameC = variable.toNativeUtf8().cast(); final error = libgit2.git_config_get_entry(out, configPointer, nameC); final result = out.value; @@ -168,7 +167,7 @@ void setBool({ required String variable, required bool value, }) { - final nameC = variable.toChar(); + final nameC = variable.toNativeUtf8().cast(); final valueC = value ? 1 : 0; libgit2.git_config_set_bool(configPointer, nameC, valueC); calloc.free(nameC); @@ -181,7 +180,7 @@ void setInt({ required String variable, required int value, }) { - final nameC = variable.toChar(); + final nameC = variable.toNativeUtf8().cast(); libgit2.git_config_set_int64(configPointer, nameC, value); calloc.free(nameC); } @@ -193,8 +192,8 @@ void setString({ required String variable, required String value, }) { - final nameC = variable.toChar(); - final valueC = value.toChar(); + final nameC = variable.toNativeUtf8().cast(); + final valueC = value.toNativeUtf8().cast(); libgit2.git_config_set_string(configPointer, nameC, valueC); calloc.free(nameC); calloc.free(valueC); @@ -221,7 +220,7 @@ void delete({ required Pointer configPointer, required String variable, }) { - final nameC = variable.toChar(); + final nameC = variable.toNativeUtf8().cast(); final error = libgit2.git_config_delete_entry(configPointer, nameC); calloc.free(nameC); @@ -244,8 +243,8 @@ List multivarValues({ required String variable, String? regexp, }) { - final nameC = variable.toChar(); - final regexpC = regexp?.toChar() ?? nullptr; + final nameC = variable.toNativeUtf8().cast(); + final regexpC = regexp?.toNativeUtf8().cast() ?? nullptr; final iterator = calloc>(); final entry = calloc>(); @@ -262,7 +261,7 @@ List multivarValues({ while (error == 0) { error = libgit2.git_config_next(entry, iterator.value); if (error != -31) { - entries.add(entry.value.ref.value.toDartString()); + entries.add(entry.value.ref.value.cast().toDartString()); } else { break; } @@ -287,9 +286,9 @@ void setMultivar({ required String regexp, required String value, }) { - final nameC = variable.toChar(); - final regexpC = regexp.toChar(); - final valueC = value.toChar(); + final nameC = variable.toNativeUtf8().cast(); + final regexpC = regexp.toNativeUtf8().cast(); + final valueC = value.toNativeUtf8().cast(); libgit2.git_config_set_multivar(configPointer, nameC, regexpC, valueC); @@ -307,8 +306,8 @@ void deleteMultivar({ required String variable, required String regexp, }) { - final nameC = variable.toChar(); - final regexpC = regexp.toChar(); + final nameC = variable.toNativeUtf8().cast(); + final regexpC = regexp.toNativeUtf8().cast(); libgit2.git_config_delete_multivar(configPointer, nameC, regexpC); diff --git a/lib/src/bindings/credentials.dart b/lib/src/bindings/credentials.dart index 696e2ec..fffe30d 100644 --- a/lib/src/bindings/credentials.dart +++ b/lib/src/bindings/credentials.dart @@ -2,7 +2,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Create a new plain-text username and password credential object. @@ -11,8 +10,8 @@ Pointer userPass({ required String password, }) { final out = calloc>(); - final usernameC = username.toChar(); - final passwordC = password.toChar(); + final usernameC = username.toNativeUtf8().cast(); + final passwordC = password.toNativeUtf8().cast(); libgit2.git_credential_userpass_plaintext_new(out, usernameC, passwordC); @@ -33,10 +32,10 @@ Pointer sshKey({ required String passPhrase, }) { final out = calloc>(); - final usernameC = username.toChar(); - final publicKeyC = publicKey.toChar(); - final privateKeyC = privateKey.toChar(); - final passPhraseC = passPhrase.toChar(); + final usernameC = username.toNativeUtf8().cast(); + final publicKeyC = publicKey.toNativeUtf8().cast(); + final privateKeyC = privateKey.toNativeUtf8().cast(); + final passPhraseC = passPhrase.toNativeUtf8().cast(); libgit2.git_credential_ssh_key_new( out, @@ -60,7 +59,7 @@ Pointer sshKey({ /// Create a new ssh key credential object used for querying an ssh-agent. Pointer sshKeyFromAgent(String username) { final out = calloc>(); - final usernameC = username.toChar(); + final usernameC = username.toNativeUtf8().cast(); libgit2.git_credential_ssh_key_from_agent(out, usernameC); @@ -80,10 +79,10 @@ Pointer sshKeyFromMemory({ required String passPhrase, }) { final out = calloc>(); - final usernameC = username.toChar(); - final publicKeyC = publicKey.toChar(); - final privateKeyC = privateKey.toChar(); - final passPhraseC = passPhrase.toChar(); + final usernameC = username.toNativeUtf8().cast(); + final publicKeyC = publicKey.toNativeUtf8().cast(); + final privateKeyC = privateKey.toNativeUtf8().cast(); + final passPhraseC = passPhrase.toNativeUtf8().cast(); libgit2.git_credential_ssh_key_memory_new( out, diff --git a/lib/src/bindings/describe.dart b/lib/src/bindings/describe.dart index 4529f59..924f06b 100644 --- a/lib/src/bindings/describe.dart +++ b/lib/src/bindings/describe.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Describe a commit. The returned describe result must be freed with [free]. @@ -101,12 +100,12 @@ String format({ opts.ref.always_use_long_format = alwaysUseLongFormat ? 1 : 0; } if (dirtySuffix != null) { - opts.ref.dirty_suffix = dirtySuffix.toChar(); + opts.ref.dirty_suffix = dirtySuffix.toNativeUtf8().cast(); } libgit2.git_describe_format(out, describeResultPointer, opts); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -141,7 +140,7 @@ Pointer _initOpts({ opts.ref.describe_strategy = describeStrategy; } if (pattern != null) { - opts.ref.pattern = pattern.toChar(); + opts.ref.pattern = pattern.toNativeUtf8().cast(); } if (onlyFollowFirstParent != null) { opts.ref.only_follow_first_parent = onlyFollowFirstParent ? 1 : 0; diff --git a/lib/src/bindings/diff.dart b/lib/src/bindings/diff.dart index 8e1d27c..d3288ea 100644 --- a/lib/src/bindings/diff.dart +++ b/lib/src/bindings/diff.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Create a diff with the difference between two index objects. The returned @@ -254,7 +253,7 @@ void merge({ /// other types of patch files. Pointer parse(String content) { final out = calloc>(); - final contentC = content.toChar(); + final contentC = content.toNativeUtf8().cast(); libgit2.git_diff_from_buffer(out, contentC, content.length); final result = out.value; @@ -384,7 +383,7 @@ String statsPrint({ final out = calloc(); final error = libgit2.git_diff_stats_to_buf(out, statsPointer, format, width); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -403,7 +402,7 @@ String addToBuf(Pointer diff) { final result = out.ref.ptr == nullptr ? '' - : out.ref.ptr.toDartString(length: out.ref.size); + : out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); diff --git a/lib/src/bindings/graph.dart b/lib/src/bindings/graph.dart index ff6ab77..62fd4e2 100644 --- a/lib/src/bindings/graph.dart +++ b/lib/src/bindings/graph.dart @@ -33,8 +33,8 @@ List aheadBehind({ required Pointer localPointer, required Pointer upstreamPointer, }) { - final ahead = calloc(); - final behind = calloc(); + final ahead = calloc(); + final behind = calloc(); libgit2.git_graph_ahead_behind( ahead, diff --git a/lib/src/bindings/index.dart b/lib/src/bindings/index.dart index 5ae8db9..080cf2b 100644 --- a/lib/src/bindings/index.dart +++ b/lib/src/bindings/index.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Create an in-memory index object. @@ -46,7 +45,7 @@ void setCapabilities({ /// Get the full path to the index file on disk. String path(Pointer index) { - return libgit2.git_index_path(index).toDartString(); + return libgit2.git_index_path(index).cast().toDartString(); } /// Update the contents of an existing index object in memory by reading from @@ -126,7 +125,7 @@ Pointer writeTreeTo({ /// Find the first position of any entries which point to given path in the Git /// index. bool find({required Pointer indexPointer, required String path}) { - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final result = libgit2.git_index_find(nullptr, indexPointer, pathC); calloc.free(pathC); @@ -165,7 +164,7 @@ Pointer getByPath({ required String path, required int stage, }) { - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final result = libgit2.git_index_get_bypath(indexPointer, pathC, stage); calloc.free(pathC); @@ -232,7 +231,7 @@ void addByPath({ required Pointer indexPointer, required String path, }) { - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final error = libgit2.git_index_add_bypath(indexPointer, pathC); calloc.free(pathC); @@ -264,7 +263,7 @@ void addFromBuffer({ required Pointer entryPointer, required String buffer, }) { - final bufferC = buffer.toChar(); + final bufferC = buffer.toNativeUtf8().cast(); final error = libgit2.git_index_add_from_buffer( indexPointer, entryPointer, @@ -292,11 +291,11 @@ void addFromBuffer({ void addAll({ required Pointer indexPointer, required List pathspec, - required int flags, }) { final pathspecC = calloc(); - final pathPointers = pathspec.map((e) => e.toChar()).toList(); - final strArray = calloc>(pathspec.length); + final pathPointers = + pathspec.map((e) => e.toNativeUtf8().cast()).toList(); + final strArray = calloc>(pathspec.length); for (var i = 0; i < pathspec.length; i++) { strArray[i] = pathPointers[i]; @@ -308,7 +307,7 @@ void addAll({ final error = libgit2.git_index_add_all( indexPointer, pathspecC, - flags, + 0, nullptr, nullptr, ); @@ -339,8 +338,9 @@ void updateAll({ required List pathspec, }) { final pathspecC = calloc(); - final pathPointers = pathspec.map((e) => e.toChar()).toList(); - final strArray = calloc>(pathspec.length); + final pathPointers = + pathspec.map((e) => e.toNativeUtf8().cast()).toList(); + final strArray = calloc>(pathspec.length); for (var i = 0; i < pathspec.length; i++) { strArray[i] = pathPointers[i]; @@ -379,7 +379,7 @@ void remove({ required String path, required int stage, }) { - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final error = libgit2.git_index_remove(indexPointer, pathC, stage); calloc.free(pathC); @@ -395,7 +395,7 @@ void removeDirectory({ required String dir, required int stage, }) { - final dirC = dir.toChar(); + final dirC = dir.toNativeUtf8().cast(); libgit2.git_index_remove_directory(indexPointer, dirC, stage); calloc.free(dirC); } @@ -406,8 +406,9 @@ void removeAll({ required List pathspec, }) { final pathspecC = calloc(); - final pathPointers = pathspec.map((e) => e.toChar()).toList(); - final strArray = calloc>(pathspec.length); + final pathPointers = + pathspec.map((e) => e.toNativeUtf8().cast()).toList(); + final strArray = calloc>(pathspec.length); for (var i = 0; i < pathspec.length; i++) { strArray[i] = pathPointers[i]; @@ -510,7 +511,7 @@ void conflictRemove({ required Pointer indexPointer, required String path, }) { - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final error = libgit2.git_index_conflict_remove(indexPointer, pathC); calloc.free(pathC); diff --git a/lib/src/bindings/libgit2_bindings.dart b/lib/src/bindings/libgit2_bindings.dart index e7c322b..0e8ca58 100644 --- a/lib/src/bindings/libgit2_bindings.dart +++ b/lib/src/bindings/libgit2_bindings.dart @@ -67,9 +67,9 @@ class Libgit2 { late final _mktime = _mktimePtr.asFunction)>(); int strftime( - ffi.Pointer __s, + ffi.Pointer __s, int __maxsize, - ffi.Pointer __format, + ffi.Pointer __format, ffi.Pointer __tp, ) { return _strftime( @@ -82,16 +82,16 @@ class Libgit2 { late final _strftimePtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Size, - ffi.Pointer, ffi.Pointer)>>('strftime'); + size_t Function(ffi.Pointer, size_t, ffi.Pointer, + ffi.Pointer)>>('strftime'); late final _strftime = _strftimePtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, + int Function(ffi.Pointer, int, ffi.Pointer, ffi.Pointer)>(); int strftime_l( - ffi.Pointer __s, + ffi.Pointer __s, int __maxsize, - ffi.Pointer __format, + ffi.Pointer __format, ffi.Pointer __tp, locale_t __loc, ) { @@ -106,10 +106,10 @@ class Libgit2 { late final _strftime_lPtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Size, - ffi.Pointer, ffi.Pointer, locale_t)>>('strftime_l'); + size_t Function(ffi.Pointer, size_t, ffi.Pointer, + ffi.Pointer, locale_t)>>('strftime_l'); late final _strftime_l = _strftime_lPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, + int Function(ffi.Pointer, int, ffi.Pointer, ffi.Pointer, locale_t)>(); ffi.Pointer gmtime( @@ -174,7 +174,7 @@ class Libgit2 { late final _localtime_r = _localtime_rPtr.asFunction< ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer asctime( + ffi.Pointer asctime( ffi.Pointer __tp, ) { return _asctime( @@ -183,12 +183,12 @@ class Libgit2 { } late final _asctimePtr = _lookup< - ffi.NativeFunction Function(ffi.Pointer)>>( + ffi.NativeFunction Function(ffi.Pointer)>>( 'asctime'); late final _asctime = - _asctimePtr.asFunction Function(ffi.Pointer)>(); + _asctimePtr.asFunction Function(ffi.Pointer)>(); - ffi.Pointer ctime( + ffi.Pointer ctime( ffi.Pointer __timer, ) { return _ctime( @@ -198,13 +198,13 @@ class Libgit2 { late final _ctimePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('ctime'); + ffi.Pointer Function(ffi.Pointer)>>('ctime'); late final _ctime = _ctimePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); - ffi.Pointer asctime_r( + ffi.Pointer asctime_r( ffi.Pointer __tp, - ffi.Pointer __buf, + ffi.Pointer __buf, ) { return _asctime_r( __tp, @@ -214,14 +214,14 @@ class Libgit2 { late final _asctime_rPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('asctime_r'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('asctime_r'); late final _asctime_r = _asctime_rPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer ctime_r( + ffi.Pointer ctime_r( ffi.Pointer __timer, - ffi.Pointer __buf, + ffi.Pointer __buf, ) { return _ctime_r( __timer, @@ -231,39 +231,40 @@ class Libgit2 { late final _ctime_rPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('ctime_r'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('ctime_r'); late final _ctime_r = _ctime_rPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer>> ___tzname = - _lookup>>('__tzname'); + late final ffi.Pointer>> ___tzname = + _lookup>>('__tzname'); - ffi.Pointer> get __tzname => ___tzname.value; + ffi.Pointer> get __tzname => ___tzname.value; - set __tzname(ffi.Pointer> value) => + set __tzname(ffi.Pointer> value) => ___tzname.value = value; - late final ffi.Pointer ___daylight = _lookup('__daylight'); + late final ffi.Pointer ___daylight = + _lookup('__daylight'); int get __daylight => ___daylight.value; set __daylight(int value) => ___daylight.value = value; - late final ffi.Pointer ___timezone = - _lookup('__timezone'); + late final ffi.Pointer ___timezone = + _lookup('__timezone'); int get __timezone => ___timezone.value; set __timezone(int value) => ___timezone.value = value; - late final ffi.Pointer>> _tzname = - _lookup>>('tzname'); + late final ffi.Pointer>> _tzname = + _lookup>>('tzname'); - ffi.Pointer> get tzname => _tzname.value; + ffi.Pointer> get tzname => _tzname.value; - set tzname(ffi.Pointer> value) => _tzname.value = value; + set tzname(ffi.Pointer> value) => _tzname.value = value; void tzset() { return _tzset(); @@ -273,13 +274,13 @@ class Libgit2 { _lookup>('tzset'); late final _tzset = _tzsetPtr.asFunction(); - late final ffi.Pointer _daylight = _lookup('daylight'); + late final ffi.Pointer _daylight = _lookup('daylight'); int get daylight => _daylight.value; set daylight(int value) => _daylight.value = value; - late final ffi.Pointer _timezone = _lookup('timezone'); + late final ffi.Pointer _timezone = _lookup('timezone'); int get timezone => _timezone.value; @@ -320,7 +321,7 @@ class Libgit2 { } late final _dysizePtr = - _lookup>('dysize'); + _lookup>('dysize'); late final _dysize = _dysizePtr.asFunction(); int nanosleep( @@ -335,7 +336,7 @@ class Libgit2 { late final _nanosleepPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('nanosleep'); late final _nanosleep = _nanosleepPtr .asFunction, ffi.Pointer)>(); @@ -352,7 +353,8 @@ class Libgit2 { late final _clock_getresPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(clockid_t, ffi.Pointer)>>('clock_getres'); + ffi.Int32 Function( + clockid_t, ffi.Pointer)>>('clock_getres'); late final _clock_getres = _clock_getresPtr.asFunction)>(); @@ -368,7 +370,8 @@ class Libgit2 { late final _clock_gettimePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(clockid_t, ffi.Pointer)>>('clock_gettime'); + ffi.Int32 Function( + clockid_t, ffi.Pointer)>>('clock_gettime'); late final _clock_gettime = _clock_gettimePtr.asFunction)>(); @@ -384,7 +387,8 @@ class Libgit2 { late final _clock_settimePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(clockid_t, ffi.Pointer)>>('clock_settime'); + ffi.Int32 Function( + clockid_t, ffi.Pointer)>>('clock_settime'); late final _clock_settime = _clock_settimePtr.asFunction)>(); @@ -404,7 +408,7 @@ class Libgit2 { late final _clock_nanosleepPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(clockid_t, ffi.Int, ffi.Pointer, + ffi.Int32 Function(clockid_t, ffi.Int32, ffi.Pointer, ffi.Pointer)>>('clock_nanosleep'); late final _clock_nanosleep = _clock_nanosleepPtr.asFunction< int Function(int, int, ffi.Pointer, ffi.Pointer)>(); @@ -420,8 +424,9 @@ class Libgit2 { } late final _clock_getcpuclockidPtr = _lookup< - ffi.NativeFunction)>>( - 'clock_getcpuclockid'); + ffi.NativeFunction< + ffi.Int32 Function( + pid_t, ffi.Pointer)>>('clock_getcpuclockid'); late final _clock_getcpuclockid = _clock_getcpuclockidPtr .asFunction)>(); @@ -439,7 +444,7 @@ class Libgit2 { late final _timer_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(clockid_t, ffi.Pointer, + ffi.Int32 Function(clockid_t, ffi.Pointer, ffi.Pointer)>>('timer_create'); late final _timer_create = _timer_createPtr.asFunction< int Function(int, ffi.Pointer, ffi.Pointer)>(); @@ -453,7 +458,7 @@ class Libgit2 { } late final _timer_deletePtr = - _lookup>('timer_delete'); + _lookup>('timer_delete'); late final _timer_delete = _timer_deletePtr.asFunction(); @@ -473,7 +478,7 @@ class Libgit2 { late final _timer_settimePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(timer_t, ffi.Int, ffi.Pointer, + ffi.Int32 Function(timer_t, ffi.Int32, ffi.Pointer, ffi.Pointer)>>('timer_settime'); late final _timer_settime = _timer_settimePtr.asFunction< int Function( @@ -491,7 +496,8 @@ class Libgit2 { late final _timer_gettimePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(timer_t, ffi.Pointer)>>('timer_gettime'); + ffi.Int32 Function( + timer_t, ffi.Pointer)>>('timer_gettime'); late final _timer_gettime = _timer_gettimePtr .asFunction)>(); @@ -504,7 +510,7 @@ class Libgit2 { } late final _timer_getoverrunPtr = - _lookup>( + _lookup>( 'timer_getoverrun'); late final _timer_getoverrun = _timer_getoverrunPtr.asFunction(); @@ -520,8 +526,9 @@ class Libgit2 { } late final _timespec_getPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'timespec_get'); + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('timespec_get'); late final _timespec_get = _timespec_getPtr.asFunction, int)>(); @@ -530,13 +537,12 @@ class Libgit2 { } late final ___ctype_get_mb_cur_maxPtr = - _lookup>( - '__ctype_get_mb_cur_max'); + _lookup>('__ctype_get_mb_cur_max'); late final ___ctype_get_mb_cur_max = ___ctype_get_mb_cur_maxPtr.asFunction(); double atof( - ffi.Pointer __nptr, + ffi.Pointer __nptr, ) { return _atof( __nptr, @@ -544,13 +550,13 @@ class Libgit2 { } late final _atofPtr = - _lookup)>>( + _lookup)>>( 'atof'); late final _atof = - _atofPtr.asFunction)>(); + _atofPtr.asFunction)>(); int atoi( - ffi.Pointer __nptr, + ffi.Pointer __nptr, ) { return _atoi( __nptr, @@ -558,12 +564,12 @@ class Libgit2 { } late final _atoiPtr = - _lookup)>>( + _lookup)>>( 'atoi'); - late final _atoi = _atoiPtr.asFunction)>(); + late final _atoi = _atoiPtr.asFunction)>(); int atol( - ffi.Pointer __nptr, + ffi.Pointer __nptr, ) { return _atol( __nptr, @@ -571,12 +577,12 @@ class Libgit2 { } late final _atolPtr = - _lookup)>>( + _lookup)>>( 'atol'); - late final _atol = _atolPtr.asFunction)>(); + late final _atol = _atolPtr.asFunction)>(); int atoll( - ffi.Pointer __nptr, + ffi.Pointer __nptr, ) { return _atoll( __nptr, @@ -584,14 +590,14 @@ class Libgit2 { } late final _atollPtr = - _lookup)>>( + _lookup)>>( 'atoll'); late final _atoll = - _atollPtr.asFunction)>(); + _atollPtr.asFunction)>(); double strtod( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, ) { return _strtod( __nptr, @@ -601,15 +607,15 @@ class Libgit2 { late final _strtodPtr = _lookup< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer>)>>('strtod'); + ffi.Double Function(ffi.Pointer, + ffi.Pointer>)>>('strtod'); late final _strtod = _strtodPtr.asFunction< double Function( - ffi.Pointer, ffi.Pointer>)>(); + ffi.Pointer, ffi.Pointer>)>(); double strtof( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, ) { return _strtof( __nptr, @@ -619,15 +625,15 @@ class Libgit2 { late final _strtofPtr = _lookup< ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer>)>>('strtof'); + ffi.Float Function(ffi.Pointer, + ffi.Pointer>)>>('strtof'); late final _strtof = _strtofPtr.asFunction< double Function( - ffi.Pointer, ffi.Pointer>)>(); + ffi.Pointer, ffi.Pointer>)>(); int strtol( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtol( @@ -639,15 +645,15 @@ class Libgit2 { late final _strtolPtr = _lookup< ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtol'); + ffi.Int64 Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtol'); late final _strtol = _strtolPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); int strtoul( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtoul( @@ -659,15 +665,15 @@ class Libgit2 { late final _strtoulPtr = _lookup< ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoul'); + ffi.Uint64 Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtoul'); late final _strtoul = _strtoulPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); int strtoq( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtoq( @@ -679,15 +685,15 @@ class Libgit2 { late final _strtoqPtr = _lookup< ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoq'); + ffi.Int64 Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtoq'); late final _strtoq = _strtoqPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); int strtouq( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtouq( @@ -699,15 +705,15 @@ class Libgit2 { late final _strtouqPtr = _lookup< ffi.NativeFunction< - ffi.UnsignedLongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtouq'); + ffi.Uint64 Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtouq'); late final _strtouq = _strtouqPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); int strtoll( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtoll( @@ -719,15 +725,15 @@ class Libgit2 { late final _strtollPtr = _lookup< ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoll'); + ffi.Int64 Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtoll'); late final _strtoll = _strtollPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); int strtoull( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtoull( @@ -739,13 +745,13 @@ class Libgit2 { late final _strtoullPtr = _lookup< ffi.NativeFunction< - ffi.UnsignedLongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoull'); + ffi.Uint64 Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtoull'); late final _strtoull = _strtoullPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); - ffi.Pointer l64a( + ffi.Pointer l64a( int __n, ) { return _l64a( @@ -754,12 +760,12 @@ class Libgit2 { } late final _l64aPtr = - _lookup Function(ffi.Long)>>( + _lookup Function(ffi.Int64)>>( 'l64a'); - late final _l64a = _l64aPtr.asFunction Function(int)>(); + late final _l64a = _l64aPtr.asFunction Function(int)>(); int a64l( - ffi.Pointer __s, + ffi.Pointer __s, ) { return _a64l( __s, @@ -767,9 +773,9 @@ class Libgit2 { } late final _a64lPtr = - _lookup)>>( + _lookup)>>( 'a64l'); - late final _a64l = _a64lPtr.asFunction)>(); + late final _a64l = _a64lPtr.asFunction)>(); int select( int __nfds, @@ -789,8 +795,12 @@ class Libgit2 { late final _selectPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('select'); + ffi.Int32 Function( + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('select'); late final _select = _selectPtr.asFunction< int Function(int, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -815,8 +825,8 @@ class Libgit2 { late final _pselectPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, + ffi.Int32 Function( + ffi.Int32, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -836,7 +846,7 @@ class Libgit2 { } late final _randomPtr = - _lookup>('random'); + _lookup>('random'); late final _random = _randomPtr.asFunction(); void srandom( @@ -848,13 +858,12 @@ class Libgit2 { } late final _srandomPtr = - _lookup>( - 'srandom'); + _lookup>('srandom'); late final _srandom = _srandomPtr.asFunction(); - ffi.Pointer initstate( + ffi.Pointer initstate( int __seed, - ffi.Pointer __statebuf, + ffi.Pointer __statebuf, int __statelen, ) { return _initstate( @@ -866,13 +875,13 @@ class Libgit2 { late final _initstatePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.UnsignedInt, ffi.Pointer, ffi.Size)>>('initstate'); + ffi.Pointer Function( + ffi.Uint32, ffi.Pointer, size_t)>>('initstate'); late final _initstate = _initstatePtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); + ffi.Pointer Function(int, ffi.Pointer, int)>(); - ffi.Pointer setstate( - ffi.Pointer __statebuf, + ffi.Pointer setstate( + ffi.Pointer __statebuf, ) { return _setstate( __statebuf, @@ -881,9 +890,9 @@ class Libgit2 { late final _setstatePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('setstate'); + ffi.Pointer Function(ffi.Pointer)>>('setstate'); late final _setstate = _setstatePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int random_r( ffi.Pointer __buf, @@ -897,7 +906,7 @@ class Libgit2 { late final _random_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('random_r'); late final _random_r = _random_rPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -914,14 +923,14 @@ class Libgit2 { late final _srandom_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.UnsignedInt, ffi.Pointer)>>('srandom_r'); + ffi.Int32 Function( + ffi.Uint32, ffi.Pointer)>>('srandom_r'); late final _srandom_r = _srandom_rPtr.asFunction)>(); int initstate_r( int __seed, - ffi.Pointer __statebuf, + ffi.Pointer __statebuf, int __statelen, ffi.Pointer __buf, ) { @@ -935,14 +944,14 @@ class Libgit2 { late final _initstate_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.UnsignedInt, ffi.Pointer, ffi.Size, + ffi.Int32 Function(ffi.Uint32, ffi.Pointer, size_t, ffi.Pointer)>>('initstate_r'); late final _initstate_r = _initstate_rPtr.asFunction< int Function( - int, ffi.Pointer, int, ffi.Pointer)>(); + int, ffi.Pointer, int, ffi.Pointer)>(); int setstate_r( - ffi.Pointer __statebuf, + ffi.Pointer __statebuf, ffi.Pointer __buf, ) { return _setstate_r( @@ -953,16 +962,17 @@ class Libgit2 { late final _setstate_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('setstate_r'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('setstate_r'); late final _setstate_r = _setstate_rPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int rand() { return _rand(); } - late final _randPtr = _lookup>('rand'); + late final _randPtr = + _lookup>('rand'); late final _rand = _randPtr.asFunction(); void srand( @@ -974,22 +984,22 @@ class Libgit2 { } late final _srandPtr = - _lookup>('srand'); + _lookup>('srand'); late final _srand = _srandPtr.asFunction(); int rand_r( - ffi.Pointer __seed, + ffi.Pointer __seed, ) { return _rand_r( __seed, ); } - late final _rand_rPtr = _lookup< - ffi.NativeFunction)>>( - 'rand_r'); + late final _rand_rPtr = + _lookup)>>( + 'rand_r'); late final _rand_r = - _rand_rPtr.asFunction)>(); + _rand_rPtr.asFunction)>(); double drand48() { return _drand48(); @@ -1000,62 +1010,62 @@ class Libgit2 { late final _drand48 = _drand48Ptr.asFunction(); double erand48( - ffi.Pointer __xsubi, + ffi.Pointer __xsubi, ) { return _erand48( __xsubi, ); } - late final _erand48Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer)>>('erand48'); + late final _erand48Ptr = + _lookup)>>( + 'erand48'); late final _erand48 = - _erand48Ptr.asFunction)>(); + _erand48Ptr.asFunction)>(); int lrand48() { return _lrand48(); } late final _lrand48Ptr = - _lookup>('lrand48'); + _lookup>('lrand48'); late final _lrand48 = _lrand48Ptr.asFunction(); int nrand48( - ffi.Pointer __xsubi, + ffi.Pointer __xsubi, ) { return _nrand48( __xsubi, ); } - late final _nrand48Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer)>>('nrand48'); + late final _nrand48Ptr = + _lookup)>>( + 'nrand48'); late final _nrand48 = - _nrand48Ptr.asFunction)>(); + _nrand48Ptr.asFunction)>(); int mrand48() { return _mrand48(); } late final _mrand48Ptr = - _lookup>('mrand48'); + _lookup>('mrand48'); late final _mrand48 = _mrand48Ptr.asFunction(); int jrand48( - ffi.Pointer __xsubi, + ffi.Pointer __xsubi, ) { return _jrand48( __xsubi, ); } - late final _jrand48Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer)>>('jrand48'); + late final _jrand48Ptr = + _lookup)>>( + 'jrand48'); late final _jrand48 = - _jrand48Ptr.asFunction)>(); + _jrand48Ptr.asFunction)>(); void srand48( int __seedval, @@ -1066,11 +1076,11 @@ class Libgit2 { } late final _srand48Ptr = - _lookup>('srand48'); + _lookup>('srand48'); late final _srand48 = _srand48Ptr.asFunction(); - ffi.Pointer seed48( - ffi.Pointer __seed16v, + ffi.Pointer seed48( + ffi.Pointer __seed16v, ) { return _seed48( __seed16v, @@ -1079,25 +1089,23 @@ class Libgit2 { late final _seed48Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('seed48'); - late final _seed48 = _seed48Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>>('seed48'); + late final _seed48 = _seed48Ptr + .asFunction Function(ffi.Pointer)>(); void lcong48( - ffi.Pointer __param, + ffi.Pointer __param, ) { return _lcong48( __param, ); } - late final _lcong48Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>('lcong48'); + late final _lcong48Ptr = + _lookup)>>( + 'lcong48'); late final _lcong48 = - _lcong48Ptr.asFunction)>(); + _lcong48Ptr.asFunction)>(); int drand48_r( ffi.Pointer __buffer, @@ -1111,13 +1119,13 @@ class Libgit2 { late final _drand48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('drand48_r'); late final _drand48_r = _drand48_rPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); int erand48_r( - ffi.Pointer __xsubi, + ffi.Pointer __xsubi, ffi.Pointer __buffer, ffi.Pointer __result, ) { @@ -1130,17 +1138,15 @@ class Libgit2 { late final _erand48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('erand48_r'); late final _erand48_r = _erand48_rPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); int lrand48_r( ffi.Pointer __buffer, - ffi.Pointer __result, + ffi.Pointer __result, ) { return _lrand48_r( __buffer, @@ -1150,15 +1156,15 @@ class Libgit2 { late final _lrand48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('lrand48_r'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('lrand48_r'); late final _lrand48_r = _lrand48_rPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int nrand48_r( - ffi.Pointer __xsubi, + ffi.Pointer __xsubi, ffi.Pointer __buffer, - ffi.Pointer __result, + ffi.Pointer __result, ) { return _nrand48_r( __xsubi, @@ -1169,15 +1175,15 @@ class Libgit2 { late final _nrand48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('nrand48_r'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('nrand48_r'); late final _nrand48_r = _nrand48_rPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); int mrand48_r( ffi.Pointer __buffer, - ffi.Pointer __result, + ffi.Pointer __result, ) { return _mrand48_r( __buffer, @@ -1187,15 +1193,15 @@ class Libgit2 { late final _mrand48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('mrand48_r'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('mrand48_r'); late final _mrand48_r = _mrand48_rPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int jrand48_r( - ffi.Pointer __xsubi, + ffi.Pointer __xsubi, ffi.Pointer __buffer, - ffi.Pointer __result, + ffi.Pointer __result, ) { return _jrand48_r( __xsubi, @@ -1206,11 +1212,11 @@ class Libgit2 { late final _jrand48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('jrand48_r'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('jrand48_r'); late final _jrand48_r = _jrand48_rPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); int srand48_r( int __seedval, @@ -1224,12 +1230,13 @@ class Libgit2 { late final _srand48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Long, ffi.Pointer)>>('srand48_r'); + ffi.Int32 Function( + ffi.Int64, ffi.Pointer)>>('srand48_r'); late final _srand48_r = _srand48_rPtr.asFunction)>(); int seed48_r( - ffi.Pointer __seed16v, + ffi.Pointer __seed16v, ffi.Pointer __buffer, ) { return _seed48_r( @@ -1240,14 +1247,13 @@ class Libgit2 { late final _seed48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('seed48_r'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('seed48_r'); late final _seed48_r = _seed48_rPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); int lcong48_r( - ffi.Pointer __param, + ffi.Pointer __param, ffi.Pointer __buffer, ) { return _lcong48_r( @@ -1258,11 +1264,10 @@ class Libgit2 { late final _lcong48_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('lcong48_r'); late final _lcong48_r = _lcong48_rPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); ffi.Pointer malloc( int __size, @@ -1273,7 +1278,7 @@ class Libgit2 { } late final _mallocPtr = - _lookup Function(ffi.Size)>>( + _lookup Function(size_t)>>( 'malloc'); late final _malloc = _mallocPtr.asFunction Function(int)>(); @@ -1289,8 +1294,8 @@ class Libgit2 { } late final _callocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Size, ffi.Size)>>('calloc'); + ffi.NativeFunction Function(size_t, size_t)>>( + 'calloc'); late final _calloc = _callocPtr.asFunction Function(int, int)>(); @@ -1307,7 +1312,7 @@ class Libgit2 { late final _reallocPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('realloc'); + ffi.Pointer, size_t)>>('realloc'); late final _realloc = _reallocPtr .asFunction Function(ffi.Pointer, int)>(); @@ -1340,29 +1345,10 @@ class Libgit2 { late final _reallocarrayPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size, ffi.Size)>>('reallocarray'); + ffi.Pointer, size_t, size_t)>>('reallocarray'); late final _reallocarray = _reallocarrayPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int, int)>(); - ffi.Pointer reallocarray1( - ffi.Pointer __ptr, - int __nmemb, - int __size, - ) { - return _reallocarray1( - __ptr, - __nmemb, - __size, - ); - } - - late final _reallocarray1Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size, ffi.Size)>>('reallocarray'); - late final _reallocarray1 = _reallocarray1Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - ffi.Pointer alloca( int __size, ) { @@ -1372,7 +1358,7 @@ class Libgit2 { } late final _allocaPtr = - _lookup Function(ffi.Size)>>( + _lookup Function(size_t)>>( 'alloca'); late final _alloca = _allocaPtr.asFunction Function(int)>(); @@ -1386,7 +1372,7 @@ class Libgit2 { } late final _vallocPtr = - _lookup Function(ffi.Size)>>( + _lookup Function(size_t)>>( 'valloc'); late final _valloc = _vallocPtr.asFunction Function(int)>(); @@ -1405,8 +1391,8 @@ class Libgit2 { late final _posix_memalignPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, ffi.Size, - ffi.Size)>>('posix_memalign'); + ffi.Int32 Function(ffi.Pointer>, size_t, + size_t)>>('posix_memalign'); late final _posix_memalign = _posix_memalignPtr .asFunction>, int, int)>(); @@ -1421,8 +1407,8 @@ class Libgit2 { } late final _aligned_allocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Size, ffi.Size)>>('aligned_alloc'); + ffi.NativeFunction Function(size_t, size_t)>>( + 'aligned_alloc'); late final _aligned_alloc = _aligned_allocPtr.asFunction Function(int, int)>(); @@ -1444,7 +1430,7 @@ class Libgit2 { late final _atexitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>)>>('atexit'); late final _atexit = _atexitPtr.asFunction< int Function(ffi.Pointer>)>(); @@ -1459,7 +1445,7 @@ class Libgit2 { late final _at_quick_exitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>)>>( 'at_quick_exit'); late final _at_quick_exit = _at_quick_exitPtr.asFunction< @@ -1468,7 +1454,7 @@ class Libgit2 { int on_exit( ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>> + ffi.Void Function(ffi.Int32, ffi.Pointer)>> __func, ffi.Pointer __arg, ) { @@ -1480,16 +1466,16 @@ class Libgit2 { late final _on_exitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>>, + ffi.Void Function(ffi.Int32, ffi.Pointer)>>, ffi.Pointer)>>('on_exit'); late final _on_exit = _on_exitPtr.asFunction< int Function( ffi.Pointer< ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>>, + ffi.Void Function(ffi.Int32, ffi.Pointer)>>, ffi.Pointer)>(); void exit( @@ -1501,7 +1487,7 @@ class Libgit2 { } late final _exitPtr = - _lookup>('exit'); + _lookup>('exit'); late final _exit = _exitPtr.asFunction(); void quick_exit( @@ -1513,7 +1499,7 @@ class Libgit2 { } late final _quick_exitPtr = - _lookup>('quick_exit'); + _lookup>('quick_exit'); late final _quick_exit = _quick_exitPtr.asFunction(); void _Exit( @@ -1525,11 +1511,11 @@ class Libgit2 { } late final __ExitPtr = - _lookup>('_Exit'); + _lookup>('_Exit'); late final __Exit = __ExitPtr.asFunction(); - ffi.Pointer getenv( - ffi.Pointer __name, + ffi.Pointer getenv( + ffi.Pointer __name, ) { return _getenv( __name, @@ -1538,12 +1524,12 @@ class Libgit2 { late final _getenvPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('getenv'); + ffi.Pointer Function(ffi.Pointer)>>('getenv'); late final _getenv = _getenvPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int putenv( - ffi.Pointer __string, + ffi.Pointer __string, ) { return _putenv( __string, @@ -1551,14 +1537,14 @@ class Libgit2 { } late final _putenvPtr = - _lookup)>>( + _lookup)>>( 'putenv'); late final _putenv = - _putenvPtr.asFunction)>(); + _putenvPtr.asFunction)>(); int setenv( - ffi.Pointer __name, - ffi.Pointer __value, + ffi.Pointer __name, + ffi.Pointer __value, int __replace, ) { return _setenv( @@ -1570,13 +1556,13 @@ class Libgit2 { late final _setenvPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('setenv'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('setenv'); late final _setenv = _setenvPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); int unsetenv( - ffi.Pointer __name, + ffi.Pointer __name, ) { return _unsetenv( __name, @@ -1584,21 +1570,21 @@ class Libgit2 { } late final _unsetenvPtr = - _lookup)>>( + _lookup)>>( 'unsetenv'); late final _unsetenv = - _unsetenvPtr.asFunction)>(); + _unsetenvPtr.asFunction)>(); int clearenv() { return _clearenv(); } late final _clearenvPtr = - _lookup>('clearenv'); + _lookup>('clearenv'); late final _clearenv = _clearenvPtr.asFunction(); - ffi.Pointer mktemp( - ffi.Pointer __template, + ffi.Pointer mktemp( + ffi.Pointer __template, ) { return _mktemp( __template, @@ -1607,12 +1593,12 @@ class Libgit2 { late final _mktempPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('mktemp'); + ffi.Pointer Function(ffi.Pointer)>>('mktemp'); late final _mktemp = _mktempPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int mkstemp( - ffi.Pointer __template, + ffi.Pointer __template, ) { return _mkstemp( __template, @@ -1620,13 +1606,13 @@ class Libgit2 { } late final _mkstempPtr = - _lookup)>>( + _lookup)>>( 'mkstemp'); late final _mkstemp = - _mkstempPtr.asFunction)>(); + _mkstempPtr.asFunction)>(); int mkstemps( - ffi.Pointer __template, + ffi.Pointer __template, int __suffixlen, ) { return _mkstemps( @@ -1636,13 +1622,13 @@ class Libgit2 { } late final _mkstempsPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'mkstemps'); + ffi.NativeFunction< + ffi.Int32 Function(ffi.Pointer, ffi.Int32)>>('mkstemps'); late final _mkstemps = - _mkstempsPtr.asFunction, int)>(); + _mkstempsPtr.asFunction, int)>(); - ffi.Pointer mkdtemp( - ffi.Pointer __template, + ffi.Pointer mkdtemp( + ffi.Pointer __template, ) { return _mkdtemp( __template, @@ -1651,12 +1637,12 @@ class Libgit2 { late final _mkdtempPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('mkdtemp'); + ffi.Pointer Function(ffi.Pointer)>>('mkdtemp'); late final _mkdtemp = _mkdtempPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); int system( - ffi.Pointer __command, + ffi.Pointer __command, ) { return _system( __command, @@ -1664,14 +1650,14 @@ class Libgit2 { } late final _systemPtr = - _lookup)>>( + _lookup)>>( 'system'); late final _system = - _systemPtr.asFunction)>(); + _systemPtr.asFunction)>(); - ffi.Pointer realpath( - ffi.Pointer __name, - ffi.Pointer __resolved, + ffi.Pointer realpath( + ffi.Pointer __name, + ffi.Pointer __resolved, ) { return _realpath( __name, @@ -1681,11 +1667,11 @@ class Libgit2 { late final _realpathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('realpath'); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('realpath'); late final _realpath = _realpathPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); ffi.Pointer bsearch( ffi.Pointer __key, @@ -1708,8 +1694,8 @@ class Libgit2 { ffi.Pointer Function( ffi.Pointer, ffi.Pointer, - ffi.Size, - ffi.Size, + size_t, + size_t, __compar_fn_t)>>('bsearch'); late final _bsearch = _bsearchPtr.asFunction< ffi.Pointer Function(ffi.Pointer, @@ -1731,8 +1717,8 @@ class Libgit2 { late final _qsortPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Size, ffi.Size, - __compar_fn_t)>>('qsort'); + ffi.Void Function( + ffi.Pointer, size_t, size_t, __compar_fn_t)>>('qsort'); late final _qsort = _qsortPtr.asFunction< void Function(ffi.Pointer, int, int, __compar_fn_t)>(); @@ -1745,7 +1731,7 @@ class Libgit2 { } late final _absPtr = - _lookup>('abs'); + _lookup>('abs'); late final _abs = _absPtr.asFunction(); int labs( @@ -1757,7 +1743,7 @@ class Libgit2 { } late final _labsPtr = - _lookup>('labs'); + _lookup>('labs'); late final _labs = _labsPtr.asFunction(); int llabs( @@ -1769,7 +1755,7 @@ class Libgit2 { } late final _llabsPtr = - _lookup>('llabs'); + _lookup>('llabs'); late final _llabs = _llabsPtr.asFunction(); div_t div( @@ -1783,7 +1769,7 @@ class Libgit2 { } late final _divPtr = - _lookup>('div'); + _lookup>('div'); late final _div = _divPtr.asFunction(); ldiv_t ldiv( @@ -1797,7 +1783,8 @@ class Libgit2 { } late final _ldivPtr = - _lookup>('ldiv'); + _lookup>( + 'ldiv'); late final _ldiv = _ldivPtr.asFunction(); lldiv_t lldiv( @@ -1811,15 +1798,15 @@ class Libgit2 { } late final _lldivPtr = - _lookup>( + _lookup>( 'lldiv'); late final _lldiv = _lldivPtr.asFunction(); - ffi.Pointer ecvt( + ffi.Pointer ecvt( double __value, int __ndigit, - ffi.Pointer __decpt, - ffi.Pointer __sign, + ffi.Pointer __decpt, + ffi.Pointer __sign, ) { return _ecvt( __value, @@ -1831,17 +1818,17 @@ class Libgit2 { late final _ecvtPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Double, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('ecvt'); + ffi.Pointer Function(ffi.Double, ffi.Int32, + ffi.Pointer, ffi.Pointer)>>('ecvt'); late final _ecvt = _ecvtPtr.asFunction< - ffi.Pointer Function( - double, int, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + double, int, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer fcvt( + ffi.Pointer fcvt( double __value, int __ndigit, - ffi.Pointer __decpt, - ffi.Pointer __sign, + ffi.Pointer __decpt, + ffi.Pointer __sign, ) { return _fcvt( __value, @@ -1853,16 +1840,16 @@ class Libgit2 { late final _fcvtPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Double, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('fcvt'); + ffi.Pointer Function(ffi.Double, ffi.Int32, + ffi.Pointer, ffi.Pointer)>>('fcvt'); late final _fcvt = _fcvtPtr.asFunction< - ffi.Pointer Function( - double, int, ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + double, int, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer gcvt( + ffi.Pointer gcvt( double __value, int __ndigit, - ffi.Pointer __buf, + ffi.Pointer __buf, ) { return _gcvt( __value, @@ -1873,17 +1860,17 @@ class Libgit2 { late final _gcvtPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Double, ffi.Int, ffi.Pointer)>>('gcvt'); + ffi.Pointer Function( + ffi.Double, ffi.Int32, ffi.Pointer)>>('gcvt'); late final _gcvt = _gcvtPtr.asFunction< - ffi.Pointer Function(double, int, ffi.Pointer)>(); + ffi.Pointer Function(double, int, ffi.Pointer)>(); int ecvt_r( double __value, int __ndigit, - ffi.Pointer __decpt, - ffi.Pointer __sign, - ffi.Pointer __buf, + ffi.Pointer __decpt, + ffi.Pointer __sign, + ffi.Pointer __buf, int __len, ) { return _ecvt_r( @@ -1898,23 +1885,23 @@ class Libgit2 { late final _ecvt_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Double, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size)>>('ecvt_r'); + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + size_t)>>('ecvt_r'); late final _ecvt_r = _ecvt_rPtr.asFunction< - int Function(double, int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + int Function(double, int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); int fcvt_r( double __value, int __ndigit, - ffi.Pointer __decpt, - ffi.Pointer __sign, - ffi.Pointer __buf, + ffi.Pointer __decpt, + ffi.Pointer __sign, + ffi.Pointer __buf, int __len, ) { return _fcvt_r( @@ -1929,19 +1916,19 @@ class Libgit2 { late final _fcvt_rPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Double, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size)>>('fcvt_r'); + ffi.Int32, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + size_t)>>('fcvt_r'); late final _fcvt_r = _fcvt_rPtr.asFunction< - int Function(double, int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + int Function(double, int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); int mblen( - ffi.Pointer __s, + ffi.Pointer __s, int __n, ) { return _mblen( @@ -1952,13 +1939,13 @@ class Libgit2 { late final _mblenPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size)>>('mblen'); + ffi.Int32 Function(ffi.Pointer, size_t)>>('mblen'); late final _mblen = - _mblenPtr.asFunction, int)>(); + _mblenPtr.asFunction, int)>(); int mbtowc( - ffi.Pointer __pwc, - ffi.Pointer __s, + ffi.Pointer __pwc, + ffi.Pointer __s, int __n, ) { return _mbtowc( @@ -1970,13 +1957,13 @@ class Libgit2 { late final _mbtowcPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('mbtowc'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, size_t)>>('mbtowc'); late final _mbtowc = _mbtowcPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); int wctomb( - ffi.Pointer __s, + ffi.Pointer __s, int __wchar, ) { return _wctomb( @@ -1987,13 +1974,13 @@ class Libgit2 { late final _wctombPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.WChar)>>('wctomb'); + ffi.Int32 Function(ffi.Pointer, wchar_t)>>('wctomb'); late final _wctomb = - _wctombPtr.asFunction, int)>(); + _wctombPtr.asFunction, int)>(); int mbstowcs( - ffi.Pointer __pwcs, - ffi.Pointer __s, + ffi.Pointer __pwcs, + ffi.Pointer __s, int __n, ) { return _mbstowcs( @@ -2005,14 +1992,14 @@ class Libgit2 { late final _mbstowcsPtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('mbstowcs'); + size_t Function(ffi.Pointer, ffi.Pointer, + size_t)>>('mbstowcs'); late final _mbstowcs = _mbstowcsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); int wcstombs( - ffi.Pointer __s, - ffi.Pointer __pwcs, + ffi.Pointer __s, + ffi.Pointer __pwcs, int __n, ) { return _wcstombs( @@ -2024,13 +2011,13 @@ class Libgit2 { late final _wcstombsPtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('wcstombs'); + size_t Function(ffi.Pointer, ffi.Pointer, + size_t)>>('wcstombs'); late final _wcstombs = _wcstombsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); int rpmatch( - ffi.Pointer __response, + ffi.Pointer __response, ) { return _rpmatch( __response, @@ -2038,15 +2025,15 @@ class Libgit2 { } late final _rpmatchPtr = - _lookup)>>( + _lookup)>>( 'rpmatch'); late final _rpmatch = - _rpmatchPtr.asFunction)>(); + _rpmatchPtr.asFunction)>(); int getsubopt( - ffi.Pointer> __optionp, - ffi.Pointer> __tokens, - ffi.Pointer> __valuep, + ffi.Pointer> __optionp, + ffi.Pointer> __tokens, + ffi.Pointer> __valuep, ) { return _getsubopt( __optionp, @@ -2057,15 +2044,15 @@ class Libgit2 { late final _getsuboptPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>>('getsubopt'); + ffi.Int32 Function( + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>>('getsubopt'); late final _getsubopt = _getsuboptPtr.asFunction< int Function( - ffi.Pointer>, - ffi.Pointer>, - ffi.Pointer>)>(); + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>(); int getloadavg( ffi.Pointer __loadavg, @@ -2079,7 +2066,8 @@ class Libgit2 { late final _getloadavgPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>>('getloadavg'); + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('getloadavg'); late final _getloadavg = _getloadavgPtr.asFunction, int)>(); @@ -2111,8 +2099,8 @@ class Libgit2 { late final _imaxdiv = _imaxdivPtr.asFunction(); int strtoimax( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtoimax( @@ -2124,15 +2112,15 @@ class Libgit2 { late final _strtoimaxPtr = _lookup< ffi.NativeFunction< - intmax_t Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoimax'); + intmax_t Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtoimax'); late final _strtoimax = _strtoimaxPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); int strtoumax( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, + ffi.Pointer __nptr, + ffi.Pointer> __endptr, int __base, ) { return _strtoumax( @@ -2144,11 +2132,11 @@ class Libgit2 { late final _strtoumaxPtr = _lookup< ffi.NativeFunction< - uintmax_t Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoumax'); + uintmax_t Function(ffi.Pointer, + ffi.Pointer>, ffi.Int32)>>('strtoumax'); late final _strtoumax = _strtoumaxPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + ffi.Pointer, ffi.Pointer>, int)>(); int wcstoimax( ffi.Pointer<__gwchar_t> __nptr, @@ -2165,7 +2153,7 @@ class Libgit2 { late final _wcstoimaxPtr = _lookup< ffi.NativeFunction< intmax_t Function(ffi.Pointer<__gwchar_t>, - ffi.Pointer>, ffi.Int)>>('wcstoimax'); + ffi.Pointer>, ffi.Int32)>>('wcstoimax'); late final _wcstoimax = _wcstoimaxPtr.asFunction< int Function(ffi.Pointer<__gwchar_t>, ffi.Pointer>, int)>(); @@ -2185,7 +2173,7 @@ class Libgit2 { late final _wcstoumaxPtr = _lookup< ffi.NativeFunction< uintmax_t Function(ffi.Pointer<__gwchar_t>, - ffi.Pointer>, ffi.Int)>>('wcstoumax'); + ffi.Pointer>, ffi.Int32)>>('wcstoumax'); late final _wcstoumax = _wcstoumaxPtr.asFunction< int Function(ffi.Pointer<__gwchar_t>, ffi.Pointer>, int)>(); @@ -2198,9 +2186,9 @@ class Libgit2 { /// @param rev Store the revision (patch) number /// @return 0 on success or an error code on failure int git_libgit2_version( - ffi.Pointer major, - ffi.Pointer minor, - ffi.Pointer rev, + ffi.Pointer major, + ffi.Pointer minor, + ffi.Pointer rev, ) { return _git_libgit2_version( major, @@ -2211,28 +2199,11 @@ class Libgit2 { late final _git_libgit2_versionPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_libgit2_version'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_libgit2_version'); late final _git_libgit2_version = _git_libgit2_versionPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - - /// Return the prerelease state of the libgit2 library currently being - /// used. For nightly builds during active development, this will be - /// "alpha". Releases may have a "beta" or release candidate ("rc1", - /// "rc2", etc) prerelease. For a final release, this function returns - /// NULL. - /// - /// @return the name of the prerelease state or NULL - ffi.Pointer git_libgit2_prerelease() { - return _git_libgit2_prerelease(); - } - - late final _git_libgit2_prereleasePtr = - _lookup Function()>>( - 'git_libgit2_prerelease'); - late final _git_libgit2_prerelease = - _git_libgit2_prereleasePtr.asFunction Function()>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Query compile time options for libgit2. /// @@ -2258,7 +2229,7 @@ class Libgit2 { } late final _git_libgit2_featuresPtr = - _lookup>('git_libgit2_features'); + _lookup>('git_libgit2_features'); late final _git_libgit2_features = _git_libgit2_featuresPtr.asFunction(); @@ -2509,17 +2480,39 @@ class Libgit2 { /// @return 0 on success, <0 on failure int git_libgit2_opts( int option, + ffi.Pointer out, ) { return _git_libgit2_opts( option, + out, ); } - late final _git_libgit2_optsPtr = - _lookup>( + late final _git_libgit2_optsPtr = _lookup< + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Int32, ffi.Pointer)>>('git_libgit2_opts'); + late final _git_libgit2_opts = _git_libgit2_optsPtr + .asFunction)>(); + + /// Set a library global option. + /// + /// Look at [git_libgit2_opts] + int git_libgit2_opts_set( + int option, + int value, + ) { + return _git_libgit2_opts_set( + option, + value, + ); + } + + late final _git_libgit2_opts_setPtr = + _lookup>( 'git_libgit2_opts'); - late final _git_libgit2_opts = - _git_libgit2_optsPtr.asFunction(); + late final _git_libgit2_opts_set = + _git_libgit2_opts_setPtr.asFunction(); /// Free the memory referred to by the git_buf. /// @@ -2550,7 +2543,7 @@ class Libgit2 { /// @return 0 or an error code int git_oid_fromstr( ffi.Pointer out, - ffi.Pointer str, + ffi.Pointer str, ) { return _git_oid_fromstr( out, @@ -2560,10 +2553,10 @@ class Libgit2 { late final _git_oid_fromstrPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('git_oid_fromstr'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('git_oid_fromstr'); late final _git_oid_fromstr = _git_oid_fromstrPtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Parse a hex formatted null-terminated string into a git_oid. /// @@ -2572,7 +2565,7 @@ class Libgit2 { /// @return 0 or an error code int git_oid_fromstrp( ffi.Pointer out, - ffi.Pointer str, + ffi.Pointer str, ) { return _git_oid_fromstrp( out, @@ -2582,10 +2575,10 @@ class Libgit2 { late final _git_oid_fromstrpPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_oid_fromstrp'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_oid_fromstrp'); late final _git_oid_fromstrp = _git_oid_fromstrpPtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Parse N characters of a hex formatted object id into a git_oid. /// @@ -2598,7 +2591,7 @@ class Libgit2 { /// @return 0 or an error code int git_oid_fromstrn( ffi.Pointer out, - ffi.Pointer str, + ffi.Pointer str, int length, ) { return _git_oid_fromstrn( @@ -2610,10 +2603,10 @@ class Libgit2 { late final _git_oid_fromstrnPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_oid_fromstrn'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t)>>('git_oid_fromstrn'); late final _git_oid_fromstrn = _git_oid_fromstrnPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Copy an already raw oid into a git_oid structure. /// @@ -2622,7 +2615,7 @@ class Libgit2 { /// @return 0 on success or error code int git_oid_fromraw( ffi.Pointer out, - ffi.Pointer raw, + ffi.Pointer raw, ) { return _git_oid_fromraw( out, @@ -2632,10 +2625,10 @@ class Libgit2 { late final _git_oid_fromrawPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_oid_fromraw'); - late final _git_oid_fromraw = _git_oid_fromrawPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_oid_fromraw'); + late final _git_oid_fromraw = _git_oid_fromrawPtr + .asFunction, ffi.Pointer)>(); /// Format a git_oid into a hex string. /// @@ -2647,7 +2640,7 @@ class Libgit2 { /// @param id oid structure to format. /// @return 0 on success or error code int git_oid_fmt( - ffi.Pointer out, + ffi.Pointer out, ffi.Pointer id, ) { return _git_oid_fmt( @@ -2658,10 +2651,10 @@ class Libgit2 { late final _git_oid_fmtPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('git_oid_fmt'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('git_oid_fmt'); late final _git_oid_fmt = _git_oid_fmtPtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Format a git_oid into a partial hex string. /// @@ -2672,7 +2665,7 @@ class Libgit2 { /// @param id oid structure to format. /// @return 0 on success or error code int git_oid_nfmt( - ffi.Pointer out, + ffi.Pointer out, int n, ffi.Pointer id, ) { @@ -2685,10 +2678,10 @@ class Libgit2 { late final _git_oid_nfmtPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, + ffi.Int32 Function(ffi.Pointer, size_t, ffi.Pointer)>>('git_oid_nfmt'); late final _git_oid_nfmt = _git_oid_nfmtPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); + int Function(ffi.Pointer, int, ffi.Pointer)>(); /// Format a git_oid into a loose-object path string. /// @@ -2703,7 +2696,7 @@ class Libgit2 { /// @param id oid structure to format. /// @return 0 on success, non-zero callback return value, or error code int git_oid_pathfmt( - ffi.Pointer out, + ffi.Pointer out, ffi.Pointer id, ) { return _git_oid_pathfmt( @@ -2714,10 +2707,10 @@ class Libgit2 { late final _git_oid_pathfmtPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('git_oid_pathfmt'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('git_oid_pathfmt'); late final _git_oid_pathfmt = _git_oid_pathfmtPtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Format a git_oid into a statically allocated c-string. /// @@ -2728,7 +2721,7 @@ class Libgit2 { /// /// @param oid The oid structure to format /// @return the c-string - ffi.Pointer git_oid_tostr_s( + ffi.Pointer git_oid_tostr_s( ffi.Pointer oid, ) { return _git_oid_tostr_s( @@ -2738,10 +2731,10 @@ class Libgit2 { late final _git_oid_tostr_sPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_oid_tostr_s'); late final _git_oid_tostr_s = _git_oid_tostr_sPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Format a git_oid into a buffer as a hex format c-string. /// @@ -2758,8 +2751,8 @@ class Libgit2 { /// @param id the oid structure to format. /// @return the out buffer pointer, assuming no input parameter /// errors, otherwise a pointer to an empty string. - ffi.Pointer git_oid_tostr( - ffi.Pointer out, + ffi.Pointer git_oid_tostr( + ffi.Pointer out, int n, ffi.Pointer id, ) { @@ -2772,11 +2765,11 @@ class Libgit2 { late final _git_oid_tostrPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Size, + ffi.Pointer Function(ffi.Pointer, size_t, ffi.Pointer)>>('git_oid_tostr'); late final _git_oid_tostr = _git_oid_tostrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer)>(); /// Copy an oid from one structure to another. /// @@ -2795,7 +2788,7 @@ class Libgit2 { late final _git_oid_cpyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('git_oid_cpy'); late final _git_oid_cpy = _git_oid_cpyPtr .asFunction, ffi.Pointer)>(); @@ -2817,7 +2810,7 @@ class Libgit2 { late final _git_oid_cmpPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('git_oid_cmp'); late final _git_oid_cmp = _git_oid_cmpPtr .asFunction, ffi.Pointer)>(); @@ -2839,7 +2832,7 @@ class Libgit2 { late final _git_oid_equalPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('git_oid_equal'); late final _git_oid_equal = _git_oid_equalPtr .asFunction, ffi.Pointer)>(); @@ -2865,8 +2858,8 @@ class Libgit2 { late final _git_oid_ncmpPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_oid_ncmp'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t)>>('git_oid_ncmp'); late final _git_oid_ncmp = _git_oid_ncmpPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -2877,7 +2870,7 @@ class Libgit2 { /// @return 0 in case of a match, -1 otherwise. int git_oid_streq( ffi.Pointer id, - ffi.Pointer str, + ffi.Pointer str, ) { return _git_oid_streq( id, @@ -2887,10 +2880,10 @@ class Libgit2 { late final _git_oid_streqPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('git_oid_streq'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('git_oid_streq'); late final _git_oid_streq = _git_oid_streqPtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Compare an oid to an hex formatted object id. /// @@ -2900,7 +2893,7 @@ class Libgit2 { /// 0 if id matches str, >0 if id sorts after str. int git_oid_strcmp( ffi.Pointer id, - ffi.Pointer str, + ffi.Pointer str, ) { return _git_oid_strcmp( id, @@ -2910,10 +2903,10 @@ class Libgit2 { late final _git_oid_strcmpPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('git_oid_strcmp'); + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>('git_oid_strcmp'); late final _git_oid_strcmp = _git_oid_strcmpPtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Check is an oid is all zeros. /// @@ -2927,7 +2920,7 @@ class Libgit2 { } late final _git_oid_is_zeroPtr = - _lookup)>>( + _lookup)>>( 'git_oid_is_zero'); late final _git_oid_is_zero = _git_oid_is_zeroPtr.asFunction)>(); @@ -2953,7 +2946,7 @@ class Libgit2 { } late final _git_oid_shorten_newPtr = _lookup< - ffi.NativeFunction Function(ffi.Size)>>( + ffi.NativeFunction Function(size_t)>>( 'git_oid_shorten_new'); late final _git_oid_shorten_new = _git_oid_shorten_newPtr .asFunction Function(int)>(); @@ -2982,7 +2975,7 @@ class Libgit2 { /// error occurs. int git_oid_shorten_add( ffi.Pointer os, - ffi.Pointer text_id, + ffi.Pointer text_id, ) { return _git_oid_shorten_add( os, @@ -2992,10 +2985,10 @@ class Libgit2 { late final _git_oid_shorten_addPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_oid_shorten_add'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_oid_shorten_add'); late final _git_oid_shorten_add = _git_oid_shorten_addPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Free an OID shortener instance /// @@ -3027,7 +3020,7 @@ class Libgit2 { /// @return 0 or an error code int git_repository_open( ffi.Pointer> out, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_repository_open( out, @@ -3037,11 +3030,11 @@ class Libgit2 { late final _git_repository_openPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_repository_open'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_repository_open'); late final _git_repository_open = _git_repository_openPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer)>(); + ffi.Pointer>, ffi.Pointer)>(); /// Open working tree as a repository /// @@ -3063,7 +3056,7 @@ class Libgit2 { late final _git_repository_open_from_worktreePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_open_from_worktree'); late final _git_repository_open_from_worktree = _git_repository_open_from_worktreePtr.asFunction< @@ -3091,7 +3084,7 @@ class Libgit2 { late final _git_repository_wrap_odbPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_wrap_odb'); late final _git_repository_wrap_odb = _git_repository_wrap_odbPtr.asFunction< int Function( @@ -3123,9 +3116,9 @@ class Libgit2 { /// @return 0 or an error code int git_repository_discover( ffi.Pointer out, - ffi.Pointer start_path, + ffi.Pointer start_path, int across_fs, - ffi.Pointer ceiling_dirs, + ffi.Pointer ceiling_dirs, ) { return _git_repository_discover( out, @@ -3137,11 +3130,11 @@ class Libgit2 { late final _git_repository_discoverPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Pointer)>>('git_repository_discover'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>('git_repository_discover'); late final _git_repository_discover = _git_repository_discoverPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); /// Find and open a repository with extended controls. /// @@ -3161,9 +3154,9 @@ class Libgit2 { /// (such as repo corruption or system errors). int git_repository_open_ext( ffi.Pointer> out, - ffi.Pointer path, + ffi.Pointer path, int flags, - ffi.Pointer ceiling_dirs, + ffi.Pointer ceiling_dirs, ) { return _git_repository_open_ext( out, @@ -3175,14 +3168,14 @@ class Libgit2 { late final _git_repository_open_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.UnsignedInt, - ffi.Pointer)>>('git_repository_open_ext'); + ffi.Pointer, + ffi.Uint32, + ffi.Pointer)>>('git_repository_open_ext'); late final _git_repository_open_ext = _git_repository_open_extPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer)>(); /// Open a bare repository on the serverside. /// @@ -3195,7 +3188,7 @@ class Libgit2 { /// @return 0 on success, or an error code int git_repository_open_bare( ffi.Pointer> out, - ffi.Pointer bare_path, + ffi.Pointer bare_path, ) { return _git_repository_open_bare( out, @@ -3205,12 +3198,12 @@ class Libgit2 { late final _git_repository_open_barePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_repository_open_bare'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_repository_open_bare'); late final _git_repository_open_bare = _git_repository_open_barePtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Free a previously allocated repository /// @@ -3250,7 +3243,7 @@ class Libgit2 { /// @return 0 or an error code int git_repository_init( ffi.Pointer> out, - ffi.Pointer path, + ffi.Pointer path, int is_bare, ) { return _git_repository_init( @@ -3262,11 +3255,11 @@ class Libgit2 { late final _git_repository_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.UnsignedInt)>>('git_repository_init'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, ffi.Uint32)>>('git_repository_init'); late final _git_repository_init = _git_repository_initPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, int)>(); + ffi.Pointer, int)>(); /// Initialize git_repository_init_options structure /// @@ -3288,8 +3281,8 @@ class Libgit2 { late final _git_repository_init_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_repository_init_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_repository_init_options_init'); late final _git_repository_init_options_init = _git_repository_init_options_initPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -3307,7 +3300,7 @@ class Libgit2 { /// @return 0 or an error code on failure. int git_repository_init_ext( ffi.Pointer> out, - ffi.Pointer repo_path, + ffi.Pointer repo_path, ffi.Pointer opts, ) { return _git_repository_init_ext( @@ -3319,14 +3312,14 @@ class Libgit2 { late final _git_repository_init_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( 'git_repository_init_ext'); late final _git_repository_init_ext = _git_repository_init_extPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Retrieve and resolve the reference pointed at by HEAD. /// @@ -3351,7 +3344,7 @@ class Libgit2 { late final _git_repository_headPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_head'); late final _git_repository_head = _git_repository_headPtr.asFunction< int Function(ffi.Pointer>, @@ -3366,7 +3359,7 @@ class Libgit2 { int git_repository_head_for_worktree( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_repository_head_for_worktree( out, @@ -3377,14 +3370,14 @@ class Libgit2 { late final _git_repository_head_for_worktreePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_repository_head_for_worktree'); + ffi.Pointer)>>('git_repository_head_for_worktree'); late final _git_repository_head_for_worktree = _git_repository_head_for_worktreePtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Check if a repository's HEAD is detached /// @@ -3403,7 +3396,7 @@ class Libgit2 { } late final _git_repository_head_detachedPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_head_detached'); late final _git_repository_head_detached = _git_repository_head_detachedPtr .asFunction)>(); @@ -3419,7 +3412,7 @@ class Libgit2 { /// there was an error int git_repository_head_detached_for_worktree( ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_repository_head_detached_for_worktree( repo, @@ -3429,12 +3422,12 @@ class Libgit2 { late final _git_repository_head_detached_for_worktreePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>( + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>( 'git_repository_head_detached_for_worktree'); late final _git_repository_head_detached_for_worktree = _git_repository_head_detached_for_worktreePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Check if the current branch is unborn /// @@ -3453,7 +3446,7 @@ class Libgit2 { } late final _git_repository_head_unbornPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_head_unborn'); late final _git_repository_head_unborn = _git_repository_head_unbornPtr .asFunction)>(); @@ -3475,7 +3468,7 @@ class Libgit2 { } late final _git_repository_is_emptyPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_is_empty'); late final _git_repository_is_empty = _git_repository_is_emptyPtr .asFunction)>(); @@ -3506,7 +3499,7 @@ class Libgit2 { late final _git_repository_item_pathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_repository_item_path'); late final _git_repository_item_path = _git_repository_item_pathPtr.asFunction< @@ -3520,7 +3513,7 @@ class Libgit2 { /// /// @param repo A repository object /// @return the path to the repository - ffi.Pointer git_repository_path( + ffi.Pointer git_repository_path( ffi.Pointer repo, ) { return _git_repository_path( @@ -3530,10 +3523,10 @@ class Libgit2 { late final _git_repository_pathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_repository_path'); late final _git_repository_path = _git_repository_pathPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Get the path of the working directory for this repository /// @@ -3542,7 +3535,7 @@ class Libgit2 { /// /// @param repo A repository object /// @return the path to the working dir, if it exists - ffi.Pointer git_repository_workdir( + ffi.Pointer git_repository_workdir( ffi.Pointer repo, ) { return _git_repository_workdir( @@ -3552,10 +3545,10 @@ class Libgit2 { late final _git_repository_workdirPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_repository_workdir'); late final _git_repository_workdir = _git_repository_workdirPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Get the path of the shared common directory for this repository. /// @@ -3565,7 +3558,7 @@ class Libgit2 { /// /// @param repo A repository object /// @return the path to the common dir - ffi.Pointer git_repository_commondir( + ffi.Pointer git_repository_commondir( ffi.Pointer repo, ) { return _git_repository_commondir( @@ -3575,11 +3568,11 @@ class Libgit2 { late final _git_repository_commondirPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_repository_commondir'); late final _git_repository_commondir = _git_repository_commondirPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Set the path to the working directory for this repository /// @@ -3598,7 +3591,7 @@ class Libgit2 { /// @return 0, or an error code int git_repository_set_workdir( ffi.Pointer repo, - ffi.Pointer workdir, + ffi.Pointer workdir, int update_gitlink, ) { return _git_repository_set_workdir( @@ -3610,12 +3603,12 @@ class Libgit2 { late final _git_repository_set_workdirPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_repository_set_workdir'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('git_repository_set_workdir'); late final _git_repository_set_workdir = _git_repository_set_workdirPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Check if a repository is bare /// @@ -3630,7 +3623,7 @@ class Libgit2 { } late final _git_repository_is_barePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_is_bare'); late final _git_repository_is_bare = _git_repository_is_barePtr .asFunction)>(); @@ -3648,7 +3641,7 @@ class Libgit2 { } late final _git_repository_is_worktreePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_is_worktree'); late final _git_repository_is_worktree = _git_repository_is_worktreePtr .asFunction)>(); @@ -3677,7 +3670,7 @@ class Libgit2 { late final _git_repository_configPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_config'); late final _git_repository_config = _git_repository_configPtr.asFunction< int Function( @@ -3707,7 +3700,7 @@ class Libgit2 { late final _git_repository_config_snapshotPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_config_snapshot'); late final _git_repository_config_snapshot = _git_repository_config_snapshotPtr.asFunction< @@ -3738,7 +3731,7 @@ class Libgit2 { late final _git_repository_odbPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_odb'); late final _git_repository_odb = _git_repository_odbPtr.asFunction< int Function( @@ -3768,7 +3761,7 @@ class Libgit2 { late final _git_repository_refdbPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_refdb'); late final _git_repository_refdb = _git_repository_refdbPtr.asFunction< int Function( @@ -3798,7 +3791,7 @@ class Libgit2 { late final _git_repository_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_repository_index'); late final _git_repository_index = _git_repository_indexPtr.asFunction< int Function( @@ -3830,7 +3823,7 @@ class Libgit2 { late final _git_repository_messagePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_repository_message'); late final _git_repository_message = _git_repository_messagePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -3850,7 +3843,7 @@ class Libgit2 { } late final _git_repository_message_removePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_message_remove'); late final _git_repository_message_remove = _git_repository_message_removePtr .asFunction)>(); @@ -3869,7 +3862,7 @@ class Libgit2 { } late final _git_repository_state_cleanupPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_state_cleanup'); late final _git_repository_state_cleanup = _git_repository_state_cleanupPtr .asFunction)>(); @@ -3897,7 +3890,7 @@ class Libgit2 { late final _git_repository_fetchhead_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_repository_fetchhead_foreach_cb, ffi.Pointer)>>('git_repository_fetchhead_foreach'); @@ -3930,7 +3923,7 @@ class Libgit2 { late final _git_repository_mergehead_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_repository_mergehead_foreach_cb, ffi.Pointer)>>('git_repository_mergehead_foreach'); @@ -3965,9 +3958,9 @@ class Libgit2 { int git_repository_hashfile( ffi.Pointer out, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, int type, - ffi.Pointer as_path, + ffi.Pointer as_path, ) { return _git_repository_hashfile( out, @@ -3980,15 +3973,15 @@ class Libgit2 { late final _git_repository_hashfilePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Int32, - ffi.Pointer)>>('git_repository_hashfile'); + ffi.Pointer)>>('git_repository_hashfile'); late final _git_repository_hashfile = _git_repository_hashfilePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer)>(); /// Make the repository HEAD point to the specified reference. /// @@ -4008,7 +4001,7 @@ class Libgit2 { /// @return 0 on success, or an error code int git_repository_set_head( ffi.Pointer repo, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_repository_set_head( repo, @@ -4018,10 +4011,10 @@ class Libgit2 { late final _git_repository_set_headPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_repository_set_head'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_repository_set_head'); late final _git_repository_set_head = _git_repository_set_headPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Make the repository HEAD directly point to the Commit. /// @@ -4049,7 +4042,7 @@ class Libgit2 { late final _git_repository_set_head_detachedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_repository_set_head_detached'); late final _git_repository_set_head_detached = _git_repository_set_head_detachedPtr.asFunction< @@ -4077,7 +4070,7 @@ class Libgit2 { late final _git_repository_set_head_detached_from_annotatedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>( 'git_repository_set_head_detached_from_annotated'); late final _git_repository_set_head_detached_from_annotated = @@ -4109,7 +4102,7 @@ class Libgit2 { } late final _git_repository_detach_headPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_detach_head'); late final _git_repository_detach_head = _git_repository_detach_headPtr .asFunction)>(); @@ -4128,7 +4121,7 @@ class Libgit2 { } late final _git_repository_statePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_state'); late final _git_repository_state = _git_repository_statePtr .asFunction)>(); @@ -4145,7 +4138,7 @@ class Libgit2 { /// @return 0 on success, -1 on error int git_repository_set_namespace( ffi.Pointer repo, - ffi.Pointer nmspace, + ffi.Pointer nmspace, ) { return _git_repository_set_namespace( repo, @@ -4155,17 +4148,17 @@ class Libgit2 { late final _git_repository_set_namespacePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_repository_set_namespace'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_repository_set_namespace'); late final _git_repository_set_namespace = _git_repository_set_namespacePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Get the currently active namespace for this repository /// /// @param repo The repo /// @return the active namespace, or NULL if there isn't one - ffi.Pointer git_repository_get_namespace( + ffi.Pointer git_repository_get_namespace( ffi.Pointer repo, ) { return _git_repository_get_namespace( @@ -4175,11 +4168,11 @@ class Libgit2 { late final _git_repository_get_namespacePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_repository_get_namespace'); late final _git_repository_get_namespace = _git_repository_get_namespacePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Determine if the repository was a shallow clone /// @@ -4194,7 +4187,7 @@ class Libgit2 { } late final _git_repository_is_shallowPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_repository_is_shallow'); late final _git_repository_is_shallow = _git_repository_is_shallowPtr .asFunction)>(); @@ -4209,8 +4202,8 @@ class Libgit2 { /// @param repo the repository /// @return 0 or an error code int git_repository_ident( - ffi.Pointer> name, - ffi.Pointer> email, + ffi.Pointer> name, + ffi.Pointer> email, ffi.Pointer repo, ) { return _git_repository_ident( @@ -4222,13 +4215,13 @@ class Libgit2 { late final _git_repository_identPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - ffi.Pointer>, + ffi.Int32 Function( + ffi.Pointer>, + ffi.Pointer>, ffi.Pointer)>>('git_repository_ident'); late final _git_repository_ident = _git_repository_identPtr.asFunction< - int Function(ffi.Pointer>, - ffi.Pointer>, ffi.Pointer)>(); + int Function(ffi.Pointer>, + ffi.Pointer>, ffi.Pointer)>(); /// Set the identity to be used for writing reflogs /// @@ -4242,8 +4235,8 @@ class Libgit2 { /// @return 0 or an error code. int git_repository_set_ident( ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer email, + ffi.Pointer name, + ffi.Pointer email, ) { return _git_repository_set_ident( repo, @@ -4254,12 +4247,12 @@ class Libgit2 { late final _git_repository_set_identPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_repository_set_ident'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_repository_set_ident'); late final _git_repository_set_ident = _git_repository_set_identPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Creates a `git_annotated_commit` from the given reference. /// The resulting git_annotated_commit must be freed with @@ -4283,7 +4276,7 @@ class Libgit2 { late final _git_annotated_commit_from_refPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_annotated_commit_from_ref'); @@ -4305,8 +4298,8 @@ class Libgit2 { int git_annotated_commit_from_fetchhead( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer branch_name, - ffi.Pointer remote_url, + ffi.Pointer branch_name, + ffi.Pointer remote_url, ffi.Pointer id, ) { return _git_annotated_commit_from_fetchhead( @@ -4320,19 +4313,19 @@ class Libgit2 { late final _git_annotated_commit_from_fetchheadPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_annotated_commit_from_fetchhead'); late final _git_annotated_commit_from_fetchhead = _git_annotated_commit_from_fetchheadPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Creates a `git_annotated_commit` from the given commit id. @@ -4365,7 +4358,7 @@ class Libgit2 { late final _git_annotated_commit_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_annotated_commit_lookup'); @@ -4387,7 +4380,7 @@ class Libgit2 { int git_annotated_commit_from_revspec( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer revspec, + ffi.Pointer revspec, ) { return _git_annotated_commit_from_revspec( out, @@ -4398,14 +4391,14 @@ class Libgit2 { late final _git_annotated_commit_from_revspecPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_annotated_commit_from_revspec'); + ffi.Pointer)>>('git_annotated_commit_from_revspec'); late final _git_annotated_commit_from_revspec = _git_annotated_commit_from_revspecPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Gets the commit ID that the given `git_annotated_commit` refers to. /// @@ -4430,7 +4423,7 @@ class Libgit2 { /// /// @param commit the given annotated commit /// @return ref name. - ffi.Pointer git_annotated_commit_ref( + ffi.Pointer git_annotated_commit_ref( ffi.Pointer commit, ) { return _git_annotated_commit_ref( @@ -4440,11 +4433,11 @@ class Libgit2 { late final _git_annotated_commit_refPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_annotated_commit_ref'); late final _git_annotated_commit_ref = _git_annotated_commit_refPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Frees a `git_annotated_commit`. /// @@ -4496,7 +4489,7 @@ class Libgit2 { late final _git_object_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -4548,11 +4541,11 @@ class Libgit2 { late final _git_object_lookup_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Int32)>>('git_object_lookup_prefix'); late final _git_object_lookup_prefix = _git_object_lookup_prefixPtr.asFunction< @@ -4570,7 +4563,7 @@ class Libgit2 { int git_object_lookup_bypath( ffi.Pointer> out, ffi.Pointer treeish, - ffi.Pointer path, + ffi.Pointer path, int type, ) { return _git_object_lookup_bypath( @@ -4583,15 +4576,15 @@ class Libgit2 { late final _git_object_lookup_bypathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('git_object_lookup_bypath'); late final _git_object_lookup_bypath = _git_object_lookup_bypathPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Get the id (SHA1) of a repository object /// @@ -4634,7 +4627,7 @@ class Libgit2 { late final _git_object_short_idPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_object_short_id'); late final _git_object_short_id = _git_object_short_idPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -4716,7 +4709,7 @@ class Libgit2 { /// /// @param type object type to convert. /// @return the corresponding string representation. - ffi.Pointer git_object_type2string( + ffi.Pointer git_object_type2string( int type, ) { return _git_object_type2string( @@ -4725,17 +4718,17 @@ class Libgit2 { } late final _git_object_type2stringPtr = - _lookup Function(ffi.Int32)>>( + _lookup Function(ffi.Int32)>>( 'git_object_type2string'); late final _git_object_type2string = _git_object_type2stringPtr - .asFunction Function(int)>(); + .asFunction Function(int)>(); /// Convert a string object type representation to it's git_object_t. /// /// @param str the string to convert. /// @return the corresponding git_object_t. int git_object_string2type( - ffi.Pointer str, + ffi.Pointer str, ) { return _git_object_string2type( str, @@ -4743,10 +4736,10 @@ class Libgit2 { } late final _git_object_string2typePtr = - _lookup)>>( + _lookup)>>( 'git_object_string2type'); late final _git_object_string2type = _git_object_string2typePtr - .asFunction)>(); + .asFunction)>(); /// Determine if the given git_object_t is a valid loose object type. /// @@ -4762,7 +4755,7 @@ class Libgit2 { } late final _git_object_typeisloosePtr = - _lookup>( + _lookup>( 'git_object_typeisloose'); late final _git_object_typeisloose = _git_object_typeisloosePtr.asFunction(); @@ -4802,7 +4795,7 @@ class Libgit2 { late final _git_object_peelPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer, ffi.Int32)>>('git_object_peel'); late final _git_object_peel = _git_object_peelPtr.asFunction< int Function(ffi.Pointer>, @@ -4826,7 +4819,7 @@ class Libgit2 { late final _git_object_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_object_dup'); late final _git_object_dup = _git_object_dupPtr.asFunction< int Function( @@ -4847,8 +4840,8 @@ class Libgit2 { /// @param type The type of the object in the buffer /// @return 0 on success or an error code int git_object_rawcontent_is_valid( - ffi.Pointer valid, - ffi.Pointer buf, + ffi.Pointer valid, + ffi.Pointer buf, int len, int type, ) { @@ -4862,12 +4855,12 @@ class Libgit2 { late final _git_object_rawcontent_is_validPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Int32)>>('git_object_rawcontent_is_valid'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t, ffi.Int32)>>('git_object_rawcontent_is_valid'); late final _git_object_rawcontent_is_valid = _git_object_rawcontent_is_validPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer, int, int)>(); + ffi.Pointer, ffi.Pointer, int, int)>(); /// Lookup a tree object from the repository. /// @@ -4889,7 +4882,7 @@ class Libgit2 { late final _git_tree_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_tree_lookup'); @@ -4923,11 +4916,11 @@ class Libgit2 { late final _git_tree_lookup_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_tree_lookup_prefix'); + size_t)>>('git_tree_lookup_prefix'); late final _git_tree_lookup_prefix = _git_tree_lookup_prefixPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, ffi.Pointer, int)>(); @@ -5004,7 +4997,7 @@ class Libgit2 { } late final _git_tree_entrycountPtr = - _lookup)>>( + _lookup)>>( 'git_tree_entrycount'); late final _git_tree_entrycount = _git_tree_entrycountPtr.asFunction)>(); @@ -5019,7 +5012,7 @@ class Libgit2 { /// @return the tree entry; NULL if not found ffi.Pointer git_tree_entry_byname( ffi.Pointer tree, - ffi.Pointer filename, + ffi.Pointer filename, ) { return _git_tree_entry_byname( tree, @@ -5030,10 +5023,10 @@ class Libgit2 { late final _git_tree_entry_bynamePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('git_tree_entry_byname'); + ffi.Pointer)>>('git_tree_entry_byname'); late final _git_tree_entry_byname = _git_tree_entry_bynamePtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Lookup a tree entry by its position in the tree /// @@ -5056,7 +5049,7 @@ class Libgit2 { late final _git_tree_entry_byindexPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('git_tree_entry_byindex'); + ffi.Pointer, size_t)>>('git_tree_entry_byindex'); late final _git_tree_entry_byindex = _git_tree_entry_byindexPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -5101,7 +5094,7 @@ class Libgit2 { int git_tree_entry_bypath( ffi.Pointer> out, ffi.Pointer root, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_tree_entry_bypath( out, @@ -5112,13 +5105,13 @@ class Libgit2 { late final _git_tree_entry_bypathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_tree_entry_bypath'); + ffi.Pointer)>>('git_tree_entry_bypath'); late final _git_tree_entry_bypath = _git_tree_entry_bypathPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Duplicate a tree entry /// @@ -5140,7 +5133,7 @@ class Libgit2 { late final _git_tree_entry_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_tree_entry_dup'); late final _git_tree_entry_dup = _git_tree_entry_dupPtr.asFunction< int Function(ffi.Pointer>, @@ -5171,7 +5164,7 @@ class Libgit2 { /// /// @param entry a tree entry /// @return the name of the file - ffi.Pointer git_tree_entry_name( + ffi.Pointer git_tree_entry_name( ffi.Pointer entry, ) { return _git_tree_entry_name( @@ -5181,10 +5174,10 @@ class Libgit2 { late final _git_tree_entry_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_tree_entry_name'); late final _git_tree_entry_name = _git_tree_entry_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Get the id of the object pointed by the entry /// @@ -5279,7 +5272,7 @@ class Libgit2 { late final _git_tree_entry_cmpPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_tree_entry_cmp'); late final _git_tree_entry_cmp = _git_tree_entry_cmpPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -5306,7 +5299,7 @@ class Libgit2 { late final _git_tree_entry_to_objectPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_tree_entry_to_object'); @@ -5344,7 +5337,7 @@ class Libgit2 { late final _git_treebuilder_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_treebuilder_new'); @@ -5365,7 +5358,7 @@ class Libgit2 { } late final _git_treebuilder_clearPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_treebuilder_clear'); late final _git_treebuilder_clear = _git_treebuilder_clearPtr .asFunction)>(); @@ -5383,7 +5376,7 @@ class Libgit2 { } late final _git_treebuilder_entrycountPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_treebuilder_entrycount'); late final _git_treebuilder_entrycount = _git_treebuilder_entrycountPtr .asFunction)>(); @@ -5419,7 +5412,7 @@ class Libgit2 { /// @return pointer to the entry; NULL if not found ffi.Pointer git_treebuilder_get( ffi.Pointer bld, - ffi.Pointer filename, + ffi.Pointer filename, ) { return _git_treebuilder_get( bld, @@ -5430,10 +5423,10 @@ class Libgit2 { late final _git_treebuilder_getPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('git_treebuilder_get'); + ffi.Pointer)>>('git_treebuilder_get'); late final _git_treebuilder_get = _git_treebuilder_getPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Add or update an entry to the builder /// @@ -5464,7 +5457,7 @@ class Libgit2 { int git_treebuilder_insert( ffi.Pointer> out, ffi.Pointer bld, - ffi.Pointer filename, + ffi.Pointer filename, ffi.Pointer id, int filemode, ) { @@ -5479,17 +5472,17 @@ class Libgit2 { late final _git_treebuilder_insertPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_treebuilder_insert'); late final _git_treebuilder_insert = _git_treebuilder_insertPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); @@ -5500,7 +5493,7 @@ class Libgit2 { /// @return 0 or an error code int git_treebuilder_remove( ffi.Pointer bld, - ffi.Pointer filename, + ffi.Pointer filename, ) { return _git_treebuilder_remove( bld, @@ -5510,10 +5503,10 @@ class Libgit2 { late final _git_treebuilder_removePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_treebuilder_remove'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_treebuilder_remove'); late final _git_treebuilder_remove = _git_treebuilder_removePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Selectively remove entries in the tree /// @@ -5539,7 +5532,7 @@ class Libgit2 { late final _git_treebuilder_filterPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_treebuilder_filter_cb, ffi.Pointer)>>('git_treebuilder_filter'); @@ -5567,7 +5560,7 @@ class Libgit2 { late final _git_treebuilder_writePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_treebuilder_write'); late final _git_treebuilder_write = _git_treebuilder_writePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -5603,7 +5596,7 @@ class Libgit2 { late final _git_tree_walkPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int32, git_treewalk_cb, + ffi.Int32 Function(ffi.Pointer, ffi.Int32, git_treewalk_cb, ffi.Pointer)>>('git_tree_walk'); late final _git_tree_walk = _git_tree_walkPtr.asFunction< int Function(ffi.Pointer, int, git_treewalk_cb, @@ -5627,7 +5620,7 @@ class Libgit2 { late final _git_tree_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_tree_dup'); late final _git_tree_dup = _git_tree_dupPtr.asFunction< int Function( @@ -5670,11 +5663,11 @@ class Libgit2 { late final _git_tree_create_updatedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Pointer)>>('git_tree_create_updated'); late final _git_tree_create_updated = _git_tree_create_updatedPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -5722,7 +5715,7 @@ class Libgit2 { late final _git_strarray_copyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_strarray_copy'); late final _git_strarray_copy = _git_strarray_copyPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -5741,7 +5734,7 @@ class Libgit2 { int git_reference_lookup( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_reference_lookup( out, @@ -5752,13 +5745,13 @@ class Libgit2 { late final _git_reference_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_reference_lookup'); + ffi.Pointer)>>('git_reference_lookup'); late final _git_reference_lookup = _git_reference_lookupPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Lookup a reference by name and resolve immediately to OID. /// @@ -5776,7 +5769,7 @@ class Libgit2 { int git_reference_name_to_id( ffi.Pointer out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_reference_name_to_id( out, @@ -5787,12 +5780,12 @@ class Libgit2 { late final _git_reference_name_to_idPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_reference_name_to_id'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_reference_name_to_id'); late final _git_reference_name_to_id = _git_reference_name_to_idPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Lookup a reference by DWIMing its short name /// @@ -5806,7 +5799,7 @@ class Libgit2 { int git_reference_dwim( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer shorthand, + ffi.Pointer shorthand, ) { return _git_reference_dwim( out, @@ -5817,13 +5810,13 @@ class Libgit2 { late final _git_reference_dwimPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_reference_dwim'); + ffi.Pointer)>>('git_reference_dwim'); late final _git_reference_dwim = _git_reference_dwimPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Conditionally create a new symbolic reference. /// @@ -5868,11 +5861,11 @@ class Libgit2 { int git_reference_symbolic_create_matching( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer target, + ffi.Pointer name, + ffi.Pointer target, int force, - ffi.Pointer current_value, - ffi.Pointer log_message, + ffi.Pointer current_value, + ffi.Pointer log_message, ) { return _git_reference_symbolic_create_matching( out, @@ -5887,25 +5880,25 @@ class Libgit2 { late final _git_reference_symbolic_create_matchingPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Pointer)>>( 'git_reference_symbolic_create_matching'); late final _git_reference_symbolic_create_matching = _git_reference_symbolic_create_matchingPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Create a new symbolic reference. /// @@ -5942,10 +5935,10 @@ class Libgit2 { int git_reference_symbolic_create( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer target, + ffi.Pointer name, + ffi.Pointer target, int force, - ffi.Pointer log_message, + ffi.Pointer log_message, ) { return _git_reference_symbolic_create( out, @@ -5959,22 +5952,22 @@ class Libgit2 { late final _git_reference_symbolic_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer)>>('git_reference_symbolic_create'); + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('git_reference_symbolic_create'); late final _git_reference_symbolic_create = _git_reference_symbolic_createPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Create a new direct reference. /// @@ -6012,10 +6005,10 @@ class Libgit2 { int git_reference_create( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ffi.Pointer id, int force, - ffi.Pointer log_message, + ffi.Pointer log_message, ) { return _git_reference_create( out, @@ -6029,21 +6022,21 @@ class Libgit2 { late final _git_reference_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Int, - ffi.Pointer)>>('git_reference_create'); + ffi.Int32, + ffi.Pointer)>>('git_reference_create'); late final _git_reference_create = _git_reference_createPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Conditionally create new direct reference /// @@ -6087,11 +6080,11 @@ class Libgit2 { int git_reference_create_matching( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ffi.Pointer id, int force, ffi.Pointer current_id, - ffi.Pointer log_message, + ffi.Pointer log_message, ) { return _git_reference_create_matching( out, @@ -6106,24 +6099,24 @@ class Libgit2 { late final _git_reference_create_matchingPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Int, + ffi.Int32, ffi.Pointer, - ffi.Pointer)>>('git_reference_create_matching'); + ffi.Pointer)>>('git_reference_create_matching'); late final _git_reference_create_matching = _git_reference_create_matchingPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Get the OID pointed to by a direct reference. /// @@ -6179,7 +6172,7 @@ class Libgit2 { /// /// @param ref The reference /// @return a pointer to the name if available, NULL otherwise - ffi.Pointer git_reference_symbolic_target( + ffi.Pointer git_reference_symbolic_target( ffi.Pointer ref, ) { return _git_reference_symbolic_target( @@ -6189,10 +6182,10 @@ class Libgit2 { late final _git_reference_symbolic_targetPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_reference_symbolic_target'); late final _git_reference_symbolic_target = _git_reference_symbolic_targetPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the type of a reference. /// @@ -6220,7 +6213,7 @@ class Libgit2 { /// /// @param ref The reference /// @return the full name for the ref - ffi.Pointer git_reference_name( + ffi.Pointer git_reference_name( ffi.Pointer ref, ) { return _git_reference_name( @@ -6230,10 +6223,10 @@ class Libgit2 { late final _git_reference_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_reference_name'); late final _git_reference_name = _git_reference_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Resolve a symbolic reference to a direct reference. /// @@ -6261,7 +6254,7 @@ class Libgit2 { late final _git_reference_resolvePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_reference_resolve'); late final _git_reference_resolve = _git_reference_resolvePtr.asFunction< int Function(ffi.Pointer>, @@ -6307,8 +6300,8 @@ class Libgit2 { int git_reference_symbolic_set_target( ffi.Pointer> out, ffi.Pointer ref, - ffi.Pointer target, - ffi.Pointer log_message, + ffi.Pointer target, + ffi.Pointer log_message, ) { return _git_reference_symbolic_set_target( out, @@ -6320,18 +6313,18 @@ class Libgit2 { late final _git_reference_symbolic_set_targetPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_reference_symbolic_set_target'); + ffi.Pointer, + ffi.Pointer)>>('git_reference_symbolic_set_target'); late final _git_reference_symbolic_set_target = _git_reference_symbolic_set_targetPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Conditionally create a new reference with the same name as the given reference but a /// different OID target. The reference must be a direct reference, otherwise @@ -6349,7 +6342,7 @@ class Libgit2 { ffi.Pointer> out, ffi.Pointer ref, ffi.Pointer id, - ffi.Pointer log_message, + ffi.Pointer log_message, ) { return _git_reference_set_target( out, @@ -6361,18 +6354,18 @@ class Libgit2 { late final _git_reference_set_targetPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_reference_set_target'); + ffi.Pointer)>>('git_reference_set_target'); late final _git_reference_set_target = _git_reference_set_targetPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Rename an existing reference. /// @@ -6397,9 +6390,9 @@ class Libgit2 { int git_reference_rename( ffi.Pointer> new_ref, ffi.Pointer ref, - ffi.Pointer new_name, + ffi.Pointer new_name, int force, - ffi.Pointer log_message, + ffi.Pointer log_message, ) { return _git_reference_rename( new_ref, @@ -6412,19 +6405,19 @@ class Libgit2 { late final _git_reference_renamePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Int, - ffi.Pointer)>>('git_reference_rename'); + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('git_reference_rename'); late final _git_reference_rename = _git_reference_renamePtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Delete an existing reference. /// @@ -6445,9 +6438,9 @@ class Libgit2 { ); } - late final _git_reference_deletePtr = - _lookup)>>( - 'git_reference_delete'); + late final _git_reference_deletePtr = _lookup< + ffi.NativeFunction)>>( + 'git_reference_delete'); late final _git_reference_delete = _git_reference_deletePtr .asFunction)>(); @@ -6460,7 +6453,7 @@ class Libgit2 { /// @return 0 or an error code int git_reference_remove( ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_reference_remove( repo, @@ -6470,10 +6463,10 @@ class Libgit2 { late final _git_reference_removePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_reference_remove'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_reference_remove'); late final _git_reference_remove = _git_reference_removePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Fill a list with all the references that can be found in a repository. /// @@ -6497,7 +6490,7 @@ class Libgit2 { late final _git_reference_listPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_reference_list'); late final _git_reference_list = _git_reference_listPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -6530,7 +6523,7 @@ class Libgit2 { late final _git_reference_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_reference_foreach_cb, ffi.Pointer)>>('git_reference_foreach'); @@ -6563,7 +6556,7 @@ class Libgit2 { late final _git_reference_foreach_namePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_reference_foreach_name_cb, ffi.Pointer)>>('git_reference_foreach_name'); @@ -6591,7 +6584,7 @@ class Libgit2 { late final _git_reference_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_reference_dup'); late final _git_reference_dup = _git_reference_dupPtr.asFunction< int Function(ffi.Pointer>, @@ -6631,7 +6624,7 @@ class Libgit2 { late final _git_reference_cmpPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_reference_cmp'); late final _git_reference_cmp = _git_reference_cmpPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -6653,7 +6646,7 @@ class Libgit2 { late final _git_reference_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_reference_iterator_new'); late final _git_reference_iterator_new = _git_reference_iterator_newPtr.asFunction< @@ -6670,7 +6663,7 @@ class Libgit2 { int git_reference_iterator_glob_new( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer glob, + ffi.Pointer glob, ) { return _git_reference_iterator_glob_new( out, @@ -6681,14 +6674,14 @@ class Libgit2 { late final _git_reference_iterator_glob_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_reference_iterator_glob_new'); + ffi.Pointer)>>('git_reference_iterator_glob_new'); late final _git_reference_iterator_glob_new = _git_reference_iterator_glob_newPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Get the next reference /// @@ -6707,7 +6700,7 @@ class Libgit2 { late final _git_reference_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_reference_next'); late final _git_reference_next = _git_reference_nextPtr.asFunction< int Function(ffi.Pointer>, @@ -6723,7 +6716,7 @@ class Libgit2 { /// @param iter the iterator /// @return 0, GIT_ITEROVER if there are no more; or an error code int git_reference_next_name( - ffi.Pointer> out, + ffi.Pointer> out, ffi.Pointer iter, ) { return _git_reference_next_name( @@ -6734,10 +6727,10 @@ class Libgit2 { late final _git_reference_next_namePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_reference_next_name'); late final _git_reference_next_name = _git_reference_next_namePtr.asFunction< - int Function(ffi.Pointer>, + int Function(ffi.Pointer>, ffi.Pointer)>(); /// Free the iterator and its associated resources @@ -6776,7 +6769,7 @@ class Libgit2 { /// @return 0 on success, GIT_EUSER on non-zero callback, or error code int git_reference_foreach_glob( ffi.Pointer repo, - ffi.Pointer glob, + ffi.Pointer glob, git_reference_foreach_name_cb callback, ffi.Pointer payload, ) { @@ -6790,14 +6783,14 @@ class Libgit2 { late final _git_reference_foreach_globPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, git_reference_foreach_name_cb, ffi.Pointer)>>('git_reference_foreach_glob'); late final _git_reference_foreach_glob = _git_reference_foreach_globPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, git_reference_foreach_name_cb, ffi.Pointer)>(); /// Check if a reflog exists for the specified reference. @@ -6808,7 +6801,7 @@ class Libgit2 { /// otherwise an error code. int git_reference_has_log( ffi.Pointer repo, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_reference_has_log( repo, @@ -6818,10 +6811,10 @@ class Libgit2 { late final _git_reference_has_logPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_reference_has_log'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_reference_has_log'); late final _git_reference_has_log = _git_reference_has_logPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Ensure there is a reflog for a particular reference. /// @@ -6833,7 +6826,7 @@ class Libgit2 { /// @return 0 or an error code. int git_reference_ensure_log( ffi.Pointer repo, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_reference_ensure_log( repo, @@ -6843,11 +6836,11 @@ class Libgit2 { late final _git_reference_ensure_logPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_reference_ensure_log'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_reference_ensure_log'); late final _git_reference_ensure_log = _git_reference_ensure_logPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Check if a reference is a local branch. /// @@ -6863,9 +6856,9 @@ class Libgit2 { ); } - late final _git_reference_is_branchPtr = - _lookup)>>( - 'git_reference_is_branch'); + late final _git_reference_is_branchPtr = _lookup< + ffi.NativeFunction)>>( + 'git_reference_is_branch'); late final _git_reference_is_branch = _git_reference_is_branchPtr .asFunction)>(); @@ -6883,9 +6876,9 @@ class Libgit2 { ); } - late final _git_reference_is_remotePtr = - _lookup)>>( - 'git_reference_is_remote'); + late final _git_reference_is_remotePtr = _lookup< + ffi.NativeFunction)>>( + 'git_reference_is_remote'); late final _git_reference_is_remote = _git_reference_is_remotePtr .asFunction)>(); @@ -6903,9 +6896,9 @@ class Libgit2 { ); } - late final _git_reference_is_tagPtr = - _lookup)>>( - 'git_reference_is_tag'); + late final _git_reference_is_tagPtr = _lookup< + ffi.NativeFunction)>>( + 'git_reference_is_tag'); late final _git_reference_is_tag = _git_reference_is_tagPtr .asFunction)>(); @@ -6923,9 +6916,9 @@ class Libgit2 { ); } - late final _git_reference_is_notePtr = - _lookup)>>( - 'git_reference_is_note'); + late final _git_reference_is_notePtr = _lookup< + ffi.NativeFunction)>>( + 'git_reference_is_note'); late final _git_reference_is_note = _git_reference_is_notePtr .asFunction)>(); @@ -6948,9 +6941,9 @@ class Libgit2 { /// @return 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC /// or an error code. int git_reference_normalize_name( - ffi.Pointer buffer_out, + ffi.Pointer buffer_out, int buffer_size, - ffi.Pointer name, + ffi.Pointer name, int flags, ) { return _git_reference_normalize_name( @@ -6963,15 +6956,15 @@ class Libgit2 { late final _git_reference_normalize_namePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.UnsignedInt)>>('git_reference_normalize_name'); + ffi.Int32 Function( + ffi.Pointer, + size_t, + ffi.Pointer, + ffi.Uint32)>>('git_reference_normalize_name'); late final _git_reference_normalize_name = _git_reference_normalize_namePtr.asFunction< int Function( - ffi.Pointer, int, ffi.Pointer, int)>(); + ffi.Pointer, int, ffi.Pointer, int)>(); /// Recursively peel reference until object of the specified type is found. /// @@ -7000,7 +6993,7 @@ class Libgit2 { late final _git_reference_peelPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer, ffi.Int32)>>('git_reference_peel'); late final _git_reference_peel = _git_reference_peelPtr.asFunction< int Function(ffi.Pointer>, @@ -7020,8 +7013,8 @@ class Libgit2 { /// @param refname name to be checked. /// @return 0 on success or an error code int git_reference_name_is_valid( - ffi.Pointer valid, - ffi.Pointer refname, + ffi.Pointer valid, + ffi.Pointer refname, ) { return _git_reference_name_is_valid( valid, @@ -7031,10 +7024,11 @@ class Libgit2 { late final _git_reference_name_is_validPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_reference_name_is_valid'); - late final _git_reference_name_is_valid = _git_reference_name_is_validPtr - .asFunction, ffi.Pointer)>(); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_reference_name_is_valid'); + late final _git_reference_name_is_valid = + _git_reference_name_is_validPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// Get the reference's short name /// @@ -7046,7 +7040,7 @@ class Libgit2 { /// /// @param ref a reference /// @return the human-readable version of the name - ffi.Pointer git_reference_shorthand( + ffi.Pointer git_reference_shorthand( ffi.Pointer ref, ) { return _git_reference_shorthand( @@ -7056,10 +7050,10 @@ class Libgit2 { late final _git_reference_shorthandPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_reference_shorthand'); late final _git_reference_shorthand = _git_reference_shorthandPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Initialize git_diff_options structure /// @@ -7081,8 +7075,8 @@ class Libgit2 { late final _git_diff_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_options_init'); late final _git_diff_options_init = _git_diff_options_initPtr .asFunction, int)>(); @@ -7106,8 +7100,8 @@ class Libgit2 { late final _git_diff_find_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_find_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_find_options_init'); late final _git_diff_find_options_init = _git_diff_find_options_initPtr .asFunction, int)>(); @@ -7161,7 +7155,7 @@ class Libgit2 { late final _git_diff_tree_to_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -7211,7 +7205,7 @@ class Libgit2 { late final _git_diff_tree_to_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -7260,7 +7254,7 @@ class Libgit2 { late final _git_diff_index_to_workdirPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -7311,7 +7305,7 @@ class Libgit2 { late final _git_diff_tree_to_workdirPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -7352,7 +7346,7 @@ class Libgit2 { late final _git_diff_tree_to_workdir_with_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -7395,7 +7389,7 @@ class Libgit2 { late final _git_diff_index_to_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -7433,7 +7427,7 @@ class Libgit2 { late final _git_diff_mergePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('git_diff_merge'); late final _git_diff_merge = _git_diff_mergePtr .asFunction, ffi.Pointer)>(); @@ -7460,7 +7454,7 @@ class Libgit2 { late final _git_diff_find_similarPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_diff_find_similar'); late final _git_diff_find_similar = _git_diff_find_similarPtr.asFunction< int Function( @@ -7479,7 +7473,7 @@ class Libgit2 { } late final _git_diff_num_deltasPtr = - _lookup)>>( + _lookup)>>( 'git_diff_num_deltas'); late final _git_diff_num_deltas = _git_diff_num_deltasPtr.asFunction)>(); @@ -7505,7 +7499,7 @@ class Libgit2 { late final _git_diff_num_deltas_of_typePtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, + size_t Function(ffi.Pointer, ffi.Int32)>>('git_diff_num_deltas_of_type'); late final _git_diff_num_deltas_of_type = _git_diff_num_deltas_of_typePtr .asFunction, int)>(); @@ -7538,7 +7532,7 @@ class Libgit2 { late final _git_diff_get_deltaPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('git_diff_get_delta'); + ffi.Pointer, size_t)>>('git_diff_get_delta'); late final _git_diff_get_delta = _git_diff_get_deltaPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -7555,7 +7549,7 @@ class Libgit2 { } late final _git_diff_is_sorted_icasePtr = - _lookup)>>( + _lookup)>>( 'git_diff_is_sorted_icase'); late final _git_diff_is_sorted_icase = _git_diff_is_sorted_icasePtr .asFunction)>(); @@ -7604,7 +7598,7 @@ class Libgit2 { late final _git_diff_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_diff_file_cb, git_diff_binary_cb, @@ -7633,7 +7627,7 @@ class Libgit2 { } late final _git_diff_status_charPtr = - _lookup>( + _lookup>( 'git_diff_status_char'); late final _git_diff_status_char = _git_diff_status_charPtr.asFunction(); @@ -7664,7 +7658,7 @@ class Libgit2 { late final _git_diff_printPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int32, git_diff_line_cb, + ffi.Int32 Function(ffi.Pointer, ffi.Int32, git_diff_line_cb, ffi.Pointer)>>('git_diff_print'); late final _git_diff_print = _git_diff_printPtr.asFunction< int Function(ffi.Pointer, int, git_diff_line_cb, @@ -7692,7 +7686,7 @@ class Libgit2 { late final _git_diff_to_bufPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_diff_to_buf'); late final _git_diff_to_buf = _git_diff_to_bufPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -7725,9 +7719,9 @@ class Libgit2 { /// @return 0 on success, non-zero callback return value, or error code int git_diff_blobs( ffi.Pointer old_blob, - ffi.Pointer old_as_path, + ffi.Pointer old_as_path, ffi.Pointer new_blob, - ffi.Pointer new_as_path, + ffi.Pointer new_as_path, ffi.Pointer options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, @@ -7751,11 +7745,11 @@ class Libgit2 { late final _git_diff_blobsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, git_diff_file_cb, git_diff_binary_cb, @@ -7765,9 +7759,9 @@ class Libgit2 { late final _git_diff_blobs = _git_diff_blobsPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, git_diff_file_cb, git_diff_binary_cb, @@ -7800,10 +7794,10 @@ class Libgit2 { /// @return 0 on success, non-zero callback return value, or error code int git_diff_blob_to_buffer( ffi.Pointer old_blob, - ffi.Pointer old_as_path, - ffi.Pointer buffer, + ffi.Pointer old_as_path, + ffi.Pointer buffer, int buffer_len, - ffi.Pointer buffer_as_path, + ffi.Pointer buffer_as_path, ffi.Pointer options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, @@ -7828,12 +7822,12 @@ class Libgit2 { late final _git_diff_blob_to_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + size_t, + ffi.Pointer, ffi.Pointer, git_diff_file_cb, git_diff_binary_cb, @@ -7843,10 +7837,10 @@ class Libgit2 { late final _git_diff_blob_to_buffer = _git_diff_blob_to_bufferPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, git_diff_file_cb, git_diff_binary_cb, @@ -7876,10 +7870,10 @@ class Libgit2 { int git_diff_buffers( ffi.Pointer old_buffer, int old_len, - ffi.Pointer old_as_path, + ffi.Pointer old_as_path, ffi.Pointer new_buffer, int new_len, - ffi.Pointer new_as_path, + ffi.Pointer new_as_path, ffi.Pointer options, git_diff_file_cb file_cb, git_diff_binary_cb binary_cb, @@ -7905,13 +7899,13 @@ class Libgit2 { late final _git_diff_buffersPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Size, - ffi.Pointer, + size_t, + ffi.Pointer, ffi.Pointer, - ffi.Size, - ffi.Pointer, + size_t, + ffi.Pointer, ffi.Pointer, git_diff_file_cb, git_diff_binary_cb, @@ -7922,10 +7916,10 @@ class Libgit2 { int Function( ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, git_diff_file_cb, git_diff_binary_cb, @@ -7952,7 +7946,7 @@ class Libgit2 { /// @return 0 or an error code int git_diff_from_buffer( ffi.Pointer> out, - ffi.Pointer content, + ffi.Pointer content, int content_len, ) { return _git_diff_from_buffer( @@ -7964,11 +7958,11 @@ class Libgit2 { late final _git_diff_from_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.Size)>>('git_diff_from_buffer'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, size_t)>>('git_diff_from_buffer'); late final _git_diff_from_buffer = _git_diff_from_bufferPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer, int)>(); + ffi.Pointer>, ffi.Pointer, int)>(); /// Accumulate diff statistics for all patches. /// @@ -7987,7 +7981,7 @@ class Libgit2 { late final _git_diff_get_statsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_diff_get_stats'); late final _git_diff_get_stats = _git_diff_get_statsPtr.asFunction< int Function( @@ -8005,9 +7999,9 @@ class Libgit2 { ); } - late final _git_diff_stats_files_changedPtr = _lookup< - ffi.NativeFunction)>>( - 'git_diff_stats_files_changed'); + late final _git_diff_stats_files_changedPtr = + _lookup)>>( + 'git_diff_stats_files_changed'); late final _git_diff_stats_files_changed = _git_diff_stats_files_changedPtr .asFunction)>(); @@ -8023,9 +8017,9 @@ class Libgit2 { ); } - late final _git_diff_stats_insertionsPtr = _lookup< - ffi.NativeFunction)>>( - 'git_diff_stats_insertions'); + late final _git_diff_stats_insertionsPtr = + _lookup)>>( + 'git_diff_stats_insertions'); late final _git_diff_stats_insertions = _git_diff_stats_insertionsPtr .asFunction)>(); @@ -8041,9 +8035,9 @@ class Libgit2 { ); } - late final _git_diff_stats_deletionsPtr = _lookup< - ffi.NativeFunction)>>( - 'git_diff_stats_deletions'); + late final _git_diff_stats_deletionsPtr = + _lookup)>>( + 'git_diff_stats_deletions'); late final _git_diff_stats_deletions = _git_diff_stats_deletionsPtr .asFunction)>(); @@ -8070,8 +8064,8 @@ class Libgit2 { late final _git_diff_stats_to_bufPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Size)>>('git_diff_stats_to_buf'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, size_t)>>('git_diff_stats_to_buf'); late final _git_diff_stats_to_buf = _git_diff_stats_to_bufPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int, int)>(); @@ -8114,8 +8108,8 @@ class Libgit2 { late final _git_diff_patchid_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_patchid_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_patchid_options_init'); late final _git_diff_patchid_options_init = _git_diff_patchid_options_initPtr .asFunction, int)>(); @@ -8150,7 +8144,7 @@ class Libgit2 { late final _git_diff_patchidPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_diff_patchid'); late final _git_diff_patchid = _git_diff_patchidPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -8176,8 +8170,8 @@ class Libgit2 { late final _git_apply_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_apply_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_apply_options_init'); late final _git_apply_options_init = _git_apply_options_initPtr .asFunction, int)>(); @@ -8208,7 +8202,7 @@ class Libgit2 { late final _git_apply_to_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -8246,7 +8240,7 @@ class Libgit2 { late final _git_applyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Pointer)>>('git_apply'); late final _git_apply = _git_applyPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, @@ -8264,7 +8258,7 @@ class Libgit2 { /// @param attr The attribute /// @return the value type for the attribute int git_attr_value( - ffi.Pointer attr, + ffi.Pointer attr, ) { return _git_attr_value( attr, @@ -8272,10 +8266,10 @@ class Libgit2 { } late final _git_attr_valuePtr = - _lookup)>>( + _lookup)>>( 'git_attr_value'); late final _git_attr_value = - _git_attr_valuePtr.asFunction)>(); + _git_attr_valuePtr.asFunction)>(); /// Look up the value of one git attribute for path. /// @@ -8292,11 +8286,11 @@ class Libgit2 { /// @param name The name of the attribute to look up. /// @return 0 or an error code. int git_attr_get( - ffi.Pointer> value_out, + ffi.Pointer> value_out, ffi.Pointer repo, int flags, - ffi.Pointer path, - ffi.Pointer name, + ffi.Pointer path, + ffi.Pointer name, ) { return _git_attr_get( value_out, @@ -8309,19 +8303,19 @@ class Libgit2 { late final _git_attr_getPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, + ffi.Int32 Function( + ffi.Pointer>, ffi.Pointer, ffi.Uint32, - ffi.Pointer, - ffi.Pointer)>>('git_attr_get'); + ffi.Pointer, + ffi.Pointer)>>('git_attr_get'); late final _git_attr_get = _git_attr_getPtr.asFunction< int Function( - ffi.Pointer>, + ffi.Pointer>, ffi.Pointer, int, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Look up the value of one git attribute for path with extended options. /// @@ -8338,11 +8332,11 @@ class Libgit2 { /// @param name The name of the attribute to look up. /// @return 0 or an error code. int git_attr_get_ext( - ffi.Pointer> value_out, + ffi.Pointer> value_out, ffi.Pointer repo, ffi.Pointer opts, - ffi.Pointer path, - ffi.Pointer name, + ffi.Pointer path, + ffi.Pointer name, ) { return _git_attr_get_ext( value_out, @@ -8355,19 +8349,19 @@ class Libgit2 { late final _git_attr_get_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, + ffi.Int32 Function( + ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_attr_get_ext'); + ffi.Pointer, + ffi.Pointer)>>('git_attr_get_ext'); late final _git_attr_get_ext = _git_attr_get_extPtr.asFunction< int Function( - ffi.Pointer>, + ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Look up a list of git attributes for path. /// @@ -8398,12 +8392,12 @@ class Libgit2 { /// @param names An array of num_attr strings containing attribute names. /// @return 0 or an error code. int git_attr_get_many( - ffi.Pointer> values_out, + ffi.Pointer> values_out, ffi.Pointer repo, int flags, - ffi.Pointer path, + ffi.Pointer path, int num_attr, - ffi.Pointer> names, + ffi.Pointer> names, ) { return _git_attr_get_many( values_out, @@ -8417,21 +8411,21 @@ class Libgit2 { late final _git_attr_get_manyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, + ffi.Int32 Function( + ffi.Pointer>, ffi.Pointer, ffi.Uint32, - ffi.Pointer, - ffi.Size, - ffi.Pointer>)>>('git_attr_get_many'); + ffi.Pointer, + size_t, + ffi.Pointer>)>>('git_attr_get_many'); late final _git_attr_get_many = _git_attr_get_manyPtr.asFunction< int Function( - ffi.Pointer>, + ffi.Pointer>, ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer>)>(); + ffi.Pointer>)>(); /// Look up a list of git attributes for path with extended options. /// @@ -8449,12 +8443,12 @@ class Libgit2 { /// @param names An array of num_attr strings containing attribute names. /// @return 0 or an error code. int git_attr_get_many_ext( - ffi.Pointer> values_out, + ffi.Pointer> values_out, ffi.Pointer repo, ffi.Pointer opts, - ffi.Pointer path, + ffi.Pointer path, int num_attr, - ffi.Pointer> names, + ffi.Pointer> names, ) { return _git_attr_get_many_ext( values_out, @@ -8468,21 +8462,21 @@ class Libgit2 { late final _git_attr_get_many_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, + ffi.Int32 Function( + ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Pointer>)>>('git_attr_get_many_ext'); + ffi.Pointer, + size_t, + ffi.Pointer>)>>('git_attr_get_many_ext'); late final _git_attr_get_many_ext = _git_attr_get_many_extPtr.asFunction< int Function( - ffi.Pointer>, + ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, - ffi.Pointer>)>(); + ffi.Pointer>)>(); /// Loop over all the git attributes for a path. /// @@ -8498,7 +8492,7 @@ class Libgit2 { int git_attr_foreach( ffi.Pointer repo, int flags, - ffi.Pointer path, + ffi.Pointer path, git_attr_foreach_cb callback, ffi.Pointer payload, ) { @@ -8513,14 +8507,14 @@ class Libgit2 { late final _git_attr_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Uint32, - ffi.Pointer, + ffi.Pointer, git_attr_foreach_cb, ffi.Pointer)>>('git_attr_foreach'); late final _git_attr_foreach = _git_attr_foreachPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, + int Function(ffi.Pointer, int, ffi.Pointer, git_attr_foreach_cb, ffi.Pointer)>(); /// Loop over all the git attributes for a path with extended options. @@ -8537,7 +8531,7 @@ class Libgit2 { int git_attr_foreach_ext( ffi.Pointer repo, ffi.Pointer opts, - ffi.Pointer path, + ffi.Pointer path, git_attr_foreach_cb callback, ffi.Pointer payload, ) { @@ -8552,15 +8546,15 @@ class Libgit2 { late final _git_attr_foreach_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, git_attr_foreach_cb, ffi.Pointer)>>('git_attr_foreach_ext'); late final _git_attr_foreach_ext = _git_attr_foreach_extPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, git_attr_foreach_cb, ffi.Pointer)>(); + ffi.Pointer, git_attr_foreach_cb, ffi.Pointer)>(); /// Flush the gitattributes cache. /// @@ -8580,7 +8574,7 @@ class Libgit2 { } late final _git_attr_cache_flushPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_attr_cache_flush'); late final _git_attr_cache_flush = _git_attr_cache_flushPtr .asFunction)>(); @@ -8600,8 +8594,8 @@ class Libgit2 { /// @return 0 or an error code. int git_attr_add_macro( ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer values, + ffi.Pointer name, + ffi.Pointer values, ) { return _git_attr_add_macro( repo, @@ -8612,11 +8606,11 @@ class Libgit2 { late final _git_attr_add_macroPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_attr_add_macro'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_attr_add_macro'); late final _git_attr_add_macro = _git_attr_add_macroPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Lookup a blob object from a repository. /// @@ -8638,7 +8632,7 @@ class Libgit2 { late final _git_blob_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_blob_lookup'); @@ -8672,11 +8666,11 @@ class Libgit2 { late final _git_blob_lookup_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_blob_lookup_prefix'); + size_t)>>('git_blob_lookup_prefix'); late final _git_blob_lookup_prefix = _git_blob_lookup_prefixPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, ffi.Pointer, int)>(); @@ -8804,8 +8798,8 @@ class Libgit2 { late final _git_blob_filter_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_blob_filter_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_blob_filter_options_init'); late final _git_blob_filter_options_init = _git_blob_filter_options_initPtr .asFunction, int)>(); @@ -8832,7 +8826,7 @@ class Libgit2 { int git_blob_filter( ffi.Pointer out, ffi.Pointer blob, - ffi.Pointer as_path, + ffi.Pointer as_path, ffi.Pointer opts, ) { return _git_blob_filter( @@ -8845,14 +8839,14 @@ class Libgit2 { late final _git_blob_filterPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_blob_filter'); late final _git_blob_filter = _git_blob_filterPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Read a file from the working folder of a repository /// and write it to the Object Database as a loose blob @@ -8866,7 +8860,7 @@ class Libgit2 { int git_blob_create_from_workdir( ffi.Pointer id, ffi.Pointer repo, - ffi.Pointer relative_path, + ffi.Pointer relative_path, ) { return _git_blob_create_from_workdir( id, @@ -8877,12 +8871,12 @@ class Libgit2 { late final _git_blob_create_from_workdirPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_blob_create_from_workdir'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_blob_create_from_workdir'); late final _git_blob_create_from_workdir = _git_blob_create_from_workdirPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Read a file from the filesystem and write its content /// to the Object Database as a loose blob @@ -8895,7 +8889,7 @@ class Libgit2 { int git_blob_create_from_disk( ffi.Pointer id, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_blob_create_from_disk( id, @@ -8906,12 +8900,12 @@ class Libgit2 { late final _git_blob_create_from_diskPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_blob_create_from_disk'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_blob_create_from_disk'); late final _git_blob_create_from_disk = _git_blob_create_from_diskPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Create a stream to write a new blob into the object db /// @@ -8939,7 +8933,7 @@ class Libgit2 { int git_blob_create_from_stream( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer hintpath, + ffi.Pointer hintpath, ) { return _git_blob_create_from_stream( out, @@ -8950,14 +8944,14 @@ class Libgit2 { late final _git_blob_create_from_streamPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_blob_create_from_stream'); + ffi.Pointer)>>('git_blob_create_from_stream'); late final _git_blob_create_from_stream = _git_blob_create_from_streamPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Close the stream and write the blob to the object db /// @@ -8978,7 +8972,7 @@ class Libgit2 { late final _git_blob_create_from_stream_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>( 'git_blob_create_from_stream_commit'); late final _git_blob_create_from_stream_commit = @@ -9008,8 +9002,8 @@ class Libgit2 { late final _git_blob_create_from_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('git_blob_create_from_buffer'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, size_t)>>('git_blob_create_from_buffer'); late final _git_blob_create_from_buffer = _git_blob_create_from_bufferPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -9033,7 +9027,7 @@ class Libgit2 { } late final _git_blob_is_binaryPtr = - _lookup)>>( + _lookup)>>( 'git_blob_is_binary'); late final _git_blob_is_binary = _git_blob_is_binaryPtr.asFunction)>(); @@ -9047,7 +9041,7 @@ class Libgit2 { /// @return 1 if the content of the blob is detected /// as binary; 0 otherwise. int git_blob_data_is_binary( - ffi.Pointer data, + ffi.Pointer data, int len, ) { return _git_blob_data_is_binary( @@ -9058,10 +9052,10 @@ class Libgit2 { late final _git_blob_data_is_binaryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Size)>>('git_blob_data_is_binary'); + ffi.Int32 Function( + ffi.Pointer, size_t)>>('git_blob_data_is_binary'); late final _git_blob_data_is_binary = _git_blob_data_is_binaryPtr - .asFunction, int)>(); + .asFunction, int)>(); /// Create an in-memory copy of a blob. The copy must be explicitly /// free'd or it will leak. @@ -9081,7 +9075,7 @@ class Libgit2 { late final _git_blob_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_blob_dup'); late final _git_blob_dup = _git_blob_dupPtr.asFunction< int Function( @@ -9107,8 +9101,8 @@ class Libgit2 { late final _git_blame_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_blame_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_blame_options_init'); late final _git_blame_options_init = _git_blame_options_initPtr .asFunction, int)>(); @@ -9171,7 +9165,7 @@ class Libgit2 { late final _git_blame_get_hunk_bylinePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('git_blame_get_hunk_byline'); + ffi.Pointer, size_t)>>('git_blame_get_hunk_byline'); late final _git_blame_get_hunk_byline = _git_blame_get_hunk_bylinePtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -9188,7 +9182,7 @@ class Libgit2 { int git_blame_file( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ffi.Pointer options, ) { return _git_blame_file( @@ -9201,16 +9195,16 @@ class Libgit2 { late final _git_blame_filePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_blame_file'); late final _git_blame_file = _git_blame_filePtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Get blame data for a file that has been modified in memory. The `reference` @@ -9231,7 +9225,7 @@ class Libgit2 { int git_blame_buffer( ffi.Pointer> out, ffi.Pointer reference, - ffi.Pointer buffer, + ffi.Pointer buffer, int buffer_len, ) { return _git_blame_buffer( @@ -9244,14 +9238,14 @@ class Libgit2 { late final _git_blame_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Size)>>('git_blame_buffer'); + ffi.Pointer, + size_t)>>('git_blame_buffer'); late final _git_blame_buffer = _git_blame_bufferPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer, int)>(); /// Free memory allocated by git_blame_file or git_blame_buffer. /// @@ -9300,7 +9294,7 @@ class Libgit2 { int git_branch_create( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer branch_name, + ffi.Pointer branch_name, ffi.Pointer target, int force, ) { @@ -9315,17 +9309,17 @@ class Libgit2 { late final _git_branch_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_branch_create'); + ffi.Int32)>>('git_branch_create'); late final _git_branch_create = _git_branch_createPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); @@ -9341,7 +9335,7 @@ class Libgit2 { int git_branch_create_from_annotated( ffi.Pointer> ref_out, ffi.Pointer repository, - ffi.Pointer branch_name, + ffi.Pointer branch_name, ffi.Pointer commit, int force, ) { @@ -9356,18 +9350,18 @@ class Libgit2 { late final _git_branch_create_from_annotatedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_branch_create_from_annotated'); + ffi.Int32)>>('git_branch_create_from_annotated'); late final _git_branch_create_from_annotated = _git_branch_create_from_annotatedPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); @@ -9387,9 +9381,9 @@ class Libgit2 { ); } - late final _git_branch_deletePtr = - _lookup)>>( - 'git_branch_delete'); + late final _git_branch_deletePtr = _lookup< + ffi.NativeFunction)>>( + 'git_branch_delete'); late final _git_branch_delete = _git_branch_deletePtr .asFunction)>(); @@ -9416,7 +9410,7 @@ class Libgit2 { late final _git_branch_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Int32)>>('git_branch_iterator_new'); @@ -9444,7 +9438,7 @@ class Libgit2 { late final _git_branch_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_branch_next'); @@ -9476,8 +9470,8 @@ class Libgit2 { /// See `git_tag_create()` for rules about valid names. /// /// Note that if the move succeeds, the old reference object will not - /// be valid anymore, and should be freed immediately by the user using - /// `git_reference_free()`. + /// + be valid anymore, and should be freed immediately by the user using + /// + `git_reference_free()`. /// /// @param out New reference object for the updated name. /// @@ -9492,7 +9486,7 @@ class Libgit2 { int git_branch_move( ffi.Pointer> out, ffi.Pointer branch, - ffi.Pointer new_branch_name, + ffi.Pointer new_branch_name, int force, ) { return _git_branch_move( @@ -9505,14 +9499,14 @@ class Libgit2 { late final _git_branch_movePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('git_branch_move'); + ffi.Pointer, + ffi.Int32)>>('git_branch_move'); late final _git_branch_move = _git_branch_movePtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Lookup a branch by its name in a repository. /// @@ -9533,7 +9527,7 @@ class Libgit2 { int git_branch_lookup( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer branch_name, + ffi.Pointer branch_name, int branch_type, ) { return _git_branch_lookup( @@ -9546,14 +9540,14 @@ class Libgit2 { late final _git_branch_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('git_branch_lookup'); late final _git_branch_lookup = _git_branch_lookupPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Get the branch name /// @@ -9569,7 +9563,7 @@ class Libgit2 { /// @return 0 on success; GIT_EINVALID if the reference isn't either a local or /// remote branch, otherwise an error code. int git_branch_name( - ffi.Pointer> out, + ffi.Pointer> out, ffi.Pointer ref, ) { return _git_branch_name( @@ -9580,11 +9574,11 @@ class Libgit2 { late final _git_branch_namePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_branch_name'); late final _git_branch_name = _git_branch_namePtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer)>(); + ffi.Pointer>, ffi.Pointer)>(); /// Get the upstream of a branch /// @@ -9610,7 +9604,7 @@ class Libgit2 { late final _git_branch_upstreamPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_branch_upstream'); late final _git_branch_upstream = _git_branch_upstreamPtr.asFunction< int Function(ffi.Pointer>, @@ -9631,7 +9625,7 @@ class Libgit2 { /// or an error code int git_branch_set_upstream( ffi.Pointer branch, - ffi.Pointer branch_name, + ffi.Pointer branch_name, ) { return _git_branch_set_upstream( branch, @@ -9641,10 +9635,10 @@ class Libgit2 { late final _git_branch_set_upstreamPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_branch_set_upstream'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_branch_set_upstream'); late final _git_branch_set_upstream = _git_branch_set_upstreamPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Get the upstream name of a branch /// @@ -9661,7 +9655,7 @@ class Libgit2 { int git_branch_upstream_name( ffi.Pointer out, ffi.Pointer repo, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_branch_upstream_name( out, @@ -9672,12 +9666,12 @@ class Libgit2 { late final _git_branch_upstream_namePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_branch_upstream_name'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_branch_upstream_name'); late final _git_branch_upstream_name = _git_branch_upstream_namePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Determine if HEAD points to the given branch /// @@ -9693,9 +9687,9 @@ class Libgit2 { ); } - late final _git_branch_is_headPtr = - _lookup)>>( - 'git_branch_is_head'); + late final _git_branch_is_headPtr = _lookup< + ffi.NativeFunction)>>( + 'git_branch_is_head'); late final _git_branch_is_head = _git_branch_is_headPtr .asFunction)>(); @@ -9715,9 +9709,9 @@ class Libgit2 { ); } - late final _git_branch_is_checked_outPtr = - _lookup)>>( - 'git_branch_is_checked_out'); + late final _git_branch_is_checked_outPtr = _lookup< + ffi.NativeFunction)>>( + 'git_branch_is_checked_out'); late final _git_branch_is_checked_out = _git_branch_is_checked_outPtr .asFunction)>(); @@ -9738,7 +9732,7 @@ class Libgit2 { int git_branch_remote_name( ffi.Pointer out, ffi.Pointer repo, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_branch_remote_name( out, @@ -9749,11 +9743,11 @@ class Libgit2 { late final _git_branch_remote_namePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_branch_remote_name'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_branch_remote_name'); late final _git_branch_remote_name = _git_branch_remote_namePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Retrieve the upstream remote of a local branch /// @@ -9767,7 +9761,7 @@ class Libgit2 { int git_branch_upstream_remote( ffi.Pointer buf, ffi.Pointer repo, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_branch_upstream_remote( buf, @@ -9778,12 +9772,12 @@ class Libgit2 { late final _git_branch_upstream_remotePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_branch_upstream_remote'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_branch_upstream_remote'); late final _git_branch_upstream_remote = _git_branch_upstream_remotePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Retrieve the upstream merge of a local branch /// @@ -9797,7 +9791,7 @@ class Libgit2 { int git_branch_upstream_merge( ffi.Pointer buf, ffi.Pointer repo, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_branch_upstream_merge( buf, @@ -9808,12 +9802,12 @@ class Libgit2 { late final _git_branch_upstream_mergePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_branch_upstream_merge'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_branch_upstream_merge'); late final _git_branch_upstream_merge = _git_branch_upstream_mergePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Determine whether a branch name is valid, meaning that (when prefixed /// with `refs/heads/`) that it is a valid reference name, and that any @@ -9824,8 +9818,8 @@ class Libgit2 { /// @param name a branch name to test /// @return 0 on success or an error code int git_branch_name_is_valid( - ffi.Pointer valid, - ffi.Pointer name, + ffi.Pointer valid, + ffi.Pointer name, ) { return _git_branch_name_is_valid( valid, @@ -9835,10 +9829,11 @@ class Libgit2 { late final _git_branch_name_is_validPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_branch_name_is_valid'); - late final _git_branch_name_is_valid = _git_branch_name_is_validPtr - .asFunction, ffi.Pointer)>(); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_branch_name_is_valid'); + late final _git_branch_name_is_valid = + _git_branch_name_is_validPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// Initialize git_checkout_options structure /// @@ -9860,8 +9855,8 @@ class Libgit2 { late final _git_checkout_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_checkout_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_checkout_options_init'); late final _git_checkout_options_init = _git_checkout_options_initPtr .asFunction, int)>(); @@ -9892,7 +9887,7 @@ class Libgit2 { late final _git_checkout_headPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_checkout_head'); late final _git_checkout_head = _git_checkout_headPtr.asFunction< int Function( @@ -9919,7 +9914,9 @@ class Libgit2 { late final _git_checkout_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_checkout_index'); late final _git_checkout_index = _git_checkout_indexPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -9948,7 +9945,9 @@ class Libgit2 { late final _git_checkout_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_checkout_tree'); late final _git_checkout_tree = _git_checkout_treePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -9994,8 +9993,8 @@ class Libgit2 { late final _git_indexer_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_indexer_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_indexer_options_init'); late final _git_indexer_options_init = _git_indexer_options_initPtr .asFunction, int)>(); @@ -10012,7 +10011,7 @@ class Libgit2 { /// @return 0 or an error code. int git_indexer_new( ffi.Pointer> out, - ffi.Pointer path, + ffi.Pointer path, int mode, ffi.Pointer odb, ffi.Pointer opts, @@ -10028,14 +10027,14 @@ class Libgit2 { late final _git_indexer_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.UnsignedInt, + ffi.Pointer, + ffi.Uint32, ffi.Pointer, ffi.Pointer)>>('git_indexer_new'); late final _git_indexer_new = _git_indexer_newPtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer, + int Function(ffi.Pointer>, ffi.Pointer, int, ffi.Pointer, ffi.Pointer)>(); /// Add data to the indexer @@ -10061,10 +10060,10 @@ class Libgit2 { late final _git_indexer_appendPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Pointer)>>('git_indexer_append'); late final _git_indexer_append = _git_indexer_appendPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, @@ -10089,7 +10088,7 @@ class Libgit2 { late final _git_indexer_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_indexer_commit'); late final _git_indexer_commit = _git_indexer_commitPtr.asFunction< int Function( @@ -10125,7 +10124,7 @@ class Libgit2 { /// /// @param idx the indexer instance /// @return a NUL terminated string for the packfile name - ffi.Pointer git_indexer_name( + ffi.Pointer git_indexer_name( ffi.Pointer idx, ) { return _git_indexer_name( @@ -10135,10 +10134,10 @@ class Libgit2 { late final _git_indexer_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_indexer_name'); late final _git_indexer_name = _git_indexer_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Free the indexer and its resources /// @@ -10175,7 +10174,7 @@ class Libgit2 { /// @return 0 or an error code int git_index_open( ffi.Pointer> out, - ffi.Pointer index_path, + ffi.Pointer index_path, ) { return _git_index_open( out, @@ -10185,11 +10184,11 @@ class Libgit2 { late final _git_index_openPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_index_open'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_index_open'); late final _git_index_open = _git_index_openPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer)>(); + ffi.Pointer>, ffi.Pointer)>(); /// Create an in-memory index object. /// @@ -10210,7 +10209,7 @@ class Libgit2 { late final _git_index_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>)>>('git_index_new'); late final _git_index_new = _git_index_newPtr .asFunction>)>(); @@ -10264,7 +10263,7 @@ class Libgit2 { } late final _git_index_capsPtr = - _lookup)>>( + _lookup)>>( 'git_index_caps'); late final _git_index_caps = _git_index_capsPtr.asFunction)>(); @@ -10290,8 +10289,8 @@ class Libgit2 { late final _git_index_set_capsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int)>>('git_index_set_caps'); + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('git_index_set_caps'); late final _git_index_set_caps = _git_index_set_capsPtr .asFunction, int)>(); @@ -10311,9 +10310,9 @@ class Libgit2 { ); } - late final _git_index_versionPtr = _lookup< - ffi.NativeFunction)>>( - 'git_index_version'); + late final _git_index_versionPtr = + _lookup)>>( + 'git_index_version'); late final _git_index_version = _git_index_versionPtr.asFunction)>(); @@ -10338,8 +10337,8 @@ class Libgit2 { late final _git_index_set_versionPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_index_set_version'); + ffi.Int32 Function( + ffi.Pointer, ffi.Uint32)>>('git_index_set_version'); late final _git_index_set_version = _git_index_set_versionPtr .asFunction, int)>(); @@ -10370,7 +10369,8 @@ class Libgit2 { late final _git_index_readPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int)>>('git_index_read'); + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('git_index_read'); late final _git_index_read = _git_index_readPtr .asFunction, int)>(); @@ -10388,7 +10388,7 @@ class Libgit2 { } late final _git_index_writePtr = - _lookup)>>( + _lookup)>>( 'git_index_write'); late final _git_index_write = _git_index_writePtr.asFunction)>(); @@ -10397,7 +10397,7 @@ class Libgit2 { /// /// @param index an existing index object /// @return path to index file or NULL for in-memory index - ffi.Pointer git_index_path( + ffi.Pointer git_index_path( ffi.Pointer index, ) { return _git_index_path( @@ -10407,10 +10407,10 @@ class Libgit2 { late final _git_index_pathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_index_path'); late final _git_index_path = _git_index_pathPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the checksum of the index /// @@ -10455,7 +10455,7 @@ class Libgit2 { late final _git_index_read_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_index_read_tree'); late final _git_index_read_tree = _git_index_read_treePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -10489,7 +10489,7 @@ class Libgit2 { late final _git_index_write_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_index_write_tree'); late final _git_index_write_tree = _git_index_write_treePtr .asFunction, ffi.Pointer)>(); @@ -10521,7 +10521,7 @@ class Libgit2 { late final _git_index_write_tree_toPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_index_write_tree_to'); late final _git_index_write_tree_to = _git_index_write_tree_toPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -10540,7 +10540,7 @@ class Libgit2 { } late final _git_index_entrycountPtr = - _lookup)>>( + _lookup)>>( 'git_index_entrycount'); late final _git_index_entrycount = _git_index_entrycountPtr .asFunction)>(); @@ -10561,7 +10561,7 @@ class Libgit2 { } late final _git_index_clearPtr = - _lookup)>>( + _lookup)>>( 'git_index_clear'); late final _git_index_clear = _git_index_clearPtr.asFunction)>(); @@ -10588,7 +10588,7 @@ class Libgit2 { late final _git_index_get_byindexPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('git_index_get_byindex'); + ffi.Pointer, size_t)>>('git_index_get_byindex'); late final _git_index_get_byindex = _git_index_get_byindexPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -10604,7 +10604,7 @@ class Libgit2 { /// @return a pointer to the entry; NULL if it was not found ffi.Pointer git_index_get_bypath( ffi.Pointer index, - ffi.Pointer path, + ffi.Pointer path, int stage, ) { return _git_index_get_bypath( @@ -10617,10 +10617,10 @@ class Libgit2 { late final _git_index_get_bypathPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('git_index_get_bypath'); + ffi.Pointer, ffi.Int32)>>('git_index_get_bypath'); late final _git_index_get_bypath = _git_index_get_bypathPtr.asFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Remove an entry from the index /// @@ -10630,7 +10630,7 @@ class Libgit2 { /// @return 0 or an error code int git_index_remove( ffi.Pointer index, - ffi.Pointer path, + ffi.Pointer path, int stage, ) { return _git_index_remove( @@ -10642,10 +10642,10 @@ class Libgit2 { late final _git_index_removePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_index_remove'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('git_index_remove'); late final _git_index_remove = _git_index_removePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Remove all entries from the index under a given directory /// @@ -10655,7 +10655,7 @@ class Libgit2 { /// @return 0 or an error code int git_index_remove_directory( ffi.Pointer index, - ffi.Pointer dir, + ffi.Pointer dir, int stage, ) { return _git_index_remove_directory( @@ -10667,11 +10667,11 @@ class Libgit2 { late final _git_index_remove_directoryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_index_remove_directory'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('git_index_remove_directory'); late final _git_index_remove_directory = _git_index_remove_directoryPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Add or update an index entry from an in-memory struct /// @@ -10697,7 +10697,7 @@ class Libgit2 { late final _git_index_addPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_index_add'); late final _git_index_add = _git_index_addPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -10719,7 +10719,7 @@ class Libgit2 { } late final _git_index_entry_stagePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_index_entry_stage'); late final _git_index_entry_stage = _git_index_entry_stagePtr .asFunction)>(); @@ -10738,7 +10738,7 @@ class Libgit2 { } late final _git_index_entry_is_conflictPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_index_entry_is_conflict'); late final _git_index_entry_is_conflict = _git_index_entry_is_conflictPtr .asFunction)>(); @@ -10764,7 +10764,7 @@ class Libgit2 { late final _git_index_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_index_iterator_new'); late final _git_index_iterator_new = _git_index_iterator_newPtr.asFunction< int Function(ffi.Pointer>, @@ -10787,7 +10787,7 @@ class Libgit2 { late final _git_index_iterator_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_index_iterator_next'); late final _git_index_iterator_next = _git_index_iterator_nextPtr.asFunction< int Function(ffi.Pointer>, @@ -10831,7 +10831,7 @@ class Libgit2 { /// @return 0 or an error code int git_index_add_bypath( ffi.Pointer index, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_index_add_bypath( index, @@ -10841,10 +10841,10 @@ class Libgit2 { late final _git_index_add_bypathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_index_add_bypath'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_index_add_bypath'); late final _git_index_add_bypath = _git_index_add_bypathPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Add or update an index entry from a buffer in memory /// @@ -10886,8 +10886,11 @@ class Libgit2 { late final _git_index_add_from_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('git_index_add_from_buffer'); + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + size_t)>>('git_index_add_from_buffer'); late final _git_index_add_from_buffer = _git_index_add_from_bufferPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -10907,7 +10910,7 @@ class Libgit2 { /// @return 0 or an error code int git_index_remove_bypath( ffi.Pointer index, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_index_remove_bypath( index, @@ -10917,10 +10920,10 @@ class Libgit2 { late final _git_index_remove_bypathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_index_remove_bypath'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_index_remove_bypath'); late final _git_index_remove_bypath = _git_index_remove_bypathPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Add or update index entries matching files in the working directory. /// @@ -10984,10 +10987,10 @@ class Libgit2 { late final _git_index_add_allPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt, + ffi.Uint32, git_index_matched_path_cb, ffi.Pointer)>>('git_index_add_all'); late final _git_index_add_all = _git_index_add_allPtr.asFunction< @@ -11023,7 +11026,7 @@ class Libgit2 { late final _git_index_remove_allPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, git_index_matched_path_cb, @@ -11069,7 +11072,7 @@ class Libgit2 { late final _git_index_update_allPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, git_index_matched_path_cb, @@ -11086,9 +11089,9 @@ class Libgit2 { /// @param path path to search /// @return 0 or an error code int git_index_find( - ffi.Pointer at_pos, + ffi.Pointer at_pos, ffi.Pointer index, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_index_find( at_pos, @@ -11099,11 +11102,11 @@ class Libgit2 { late final _git_index_findPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_index_find'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_index_find'); late final _git_index_find = _git_index_findPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Find the first position of any entries matching a prefix. To find the first position /// of a path inside a given folder, suffix the prefix with a '/'. @@ -11113,9 +11116,9 @@ class Libgit2 { /// @param prefix the prefix to search for /// @return 0 or an error code int git_index_find_prefix( - ffi.Pointer at_pos, + ffi.Pointer at_pos, ffi.Pointer index, - ffi.Pointer prefix, + ffi.Pointer prefix, ) { return _git_index_find_prefix( at_pos, @@ -11126,11 +11129,11 @@ class Libgit2 { late final _git_index_find_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_index_find_prefix'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_index_find_prefix'); late final _git_index_find_prefix = _git_index_find_prefixPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Add or update index entries to represent a conflict. Any staged /// entries that exist at the given paths will be removed. @@ -11161,7 +11164,7 @@ class Libgit2 { late final _git_index_conflict_addPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -11187,7 +11190,7 @@ class Libgit2 { ffi.Pointer> our_out, ffi.Pointer> their_out, ffi.Pointer index, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_index_conflict_get( ancestor_out, @@ -11200,19 +11203,19 @@ class Libgit2 { late final _git_index_conflict_getPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer>, ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_index_conflict_get'); + ffi.Pointer)>>('git_index_conflict_get'); late final _git_index_conflict_get = _git_index_conflict_getPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer>, ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Removes the index entries that represent a conflict of a single file. /// @@ -11221,7 +11224,7 @@ class Libgit2 { /// @return 0 or an error code int git_index_conflict_remove( ffi.Pointer index, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_index_conflict_remove( index, @@ -11231,11 +11234,11 @@ class Libgit2 { late final _git_index_conflict_removePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_index_conflict_remove'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_index_conflict_remove'); late final _git_index_conflict_remove = _git_index_conflict_removePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Remove all conflicts in the index (entries with a stage greater than 0). /// @@ -11250,7 +11253,7 @@ class Libgit2 { } late final _git_index_conflict_cleanupPtr = - _lookup)>>( + _lookup)>>( 'git_index_conflict_cleanup'); late final _git_index_conflict_cleanup = _git_index_conflict_cleanupPtr .asFunction)>(); @@ -11268,7 +11271,7 @@ class Libgit2 { } late final _git_index_has_conflictsPtr = - _lookup)>>( + _lookup)>>( 'git_index_has_conflicts'); late final _git_index_has_conflicts = _git_index_has_conflictsPtr .asFunction)>(); @@ -11292,7 +11295,7 @@ class Libgit2 { late final _git_index_conflict_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer)>>('git_index_conflict_iterator_new'); late final _git_index_conflict_iterator_new = @@ -11325,7 +11328,7 @@ class Libgit2 { late final _git_index_conflict_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer>, ffi.Pointer>, @@ -11376,8 +11379,8 @@ class Libgit2 { late final _git_merge_file_input_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_merge_file_input_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_merge_file_input_init'); late final _git_merge_file_input_init = _git_merge_file_input_initPtr .asFunction, int)>(); @@ -11401,8 +11404,8 @@ class Libgit2 { late final _git_merge_file_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_merge_file_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_merge_file_options_init'); late final _git_merge_file_options_init = _git_merge_file_options_initPtr .asFunction, int)>(); @@ -11426,8 +11429,8 @@ class Libgit2 { late final _git_merge_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_merge_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_merge_options_init'); late final _git_merge_options_init = _git_merge_options_initPtr .asFunction, int)>(); @@ -11458,12 +11461,12 @@ class Libgit2 { late final _git_merge_analysisPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>, - ffi.Size)>>('git_merge_analysis'); + size_t)>>('git_merge_analysis'); late final _git_merge_analysis = _git_merge_analysisPtr.asFunction< int Function( ffi.Pointer, @@ -11502,13 +11505,13 @@ class Libgit2 { late final _git_merge_analysis_for_refPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>, - ffi.Size)>>('git_merge_analysis_for_ref'); + size_t)>>('git_merge_analysis_for_ref'); late final _git_merge_analysis_for_ref = _git_merge_analysis_for_refPtr.asFunction< int Function( @@ -11542,7 +11545,7 @@ class Libgit2 { late final _git_merge_basePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_merge_base'); late final _git_merge_base = _git_merge_basePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -11571,7 +11574,7 @@ class Libgit2 { late final _git_merge_basesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -11603,8 +11606,8 @@ class Libgit2 { late final _git_merge_base_manyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Pointer)>>('git_merge_base_many'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t, ffi.Pointer)>>('git_merge_base_many'); late final _git_merge_base_many = _git_merge_base_manyPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -11632,10 +11635,10 @@ class Libgit2 { late final _git_merge_bases_manyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Pointer)>>('git_merge_bases_many'); late final _git_merge_bases_many = _git_merge_bases_manyPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, @@ -11664,8 +11667,8 @@ class Libgit2 { late final _git_merge_base_octopusPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Pointer)>>('git_merge_base_octopus'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t, ffi.Pointer)>>('git_merge_base_octopus'); late final _git_merge_base_octopus = _git_merge_base_octopusPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -11702,7 +11705,7 @@ class Libgit2 { late final _git_merge_filePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -11748,7 +11751,7 @@ class Libgit2 { late final _git_merge_file_from_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -11818,7 +11821,7 @@ class Libgit2 { late final _git_merge_treesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -11865,7 +11868,7 @@ class Libgit2 { late final _git_merge_commitsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -11885,7 +11888,7 @@ class Libgit2 { /// completes, resolve any conflicts and prepare a commit. /// /// For compatibility with git, the repository is put into a merging - /// state. Once the commit is done (or if the user wishes to abort), + /// state. Once the commit is done (or if the uses wishes to abort), /// you should clear this state by calling /// `git_repository_state_cleanup()`. /// @@ -11913,10 +11916,10 @@ class Libgit2 { late final _git_mergePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer>, - ffi.Size, + size_t, ffi.Pointer, ffi.Pointer)>>('git_merge'); late final _git_merge = _git_mergePtr.asFunction< @@ -11947,8 +11950,8 @@ class Libgit2 { late final _git_cherrypick_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_cherrypick_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_cherrypick_options_init'); late final _git_cherrypick_options_init = _git_cherrypick_options_initPtr .asFunction, int)>(); @@ -11984,12 +11987,12 @@ class Libgit2 { late final _git_cherrypick_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt, + ffi.Uint32, ffi.Pointer)>>('git_cherrypick_commit'); late final _git_cherrypick_commit = _git_cherrypick_commitPtr.asFunction< int Function( @@ -12020,7 +12023,9 @@ class Libgit2 { late final _git_cherrypickPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_cherrypick'); late final _git_cherrypick = _git_cherrypickPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -12034,7 +12039,7 @@ class Libgit2 { /// @return 0 if the refspec string could be parsed, -1 otherwise int git_refspec_parse( ffi.Pointer> refspec, - ffi.Pointer input, + ffi.Pointer input, int is_fetch, ) { return _git_refspec_parse( @@ -12046,11 +12051,11 @@ class Libgit2 { late final _git_refspec_parsePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.Int)>>('git_refspec_parse'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, ffi.Int32)>>('git_refspec_parse'); late final _git_refspec_parse = _git_refspec_parsePtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer, int)>(); + ffi.Pointer>, ffi.Pointer, int)>(); /// Free a refspec object which has been created by git_refspec_parse /// @@ -12073,7 +12078,7 @@ class Libgit2 { /// /// @param refspec the refspec /// @return the refspec's source specifier - ffi.Pointer git_refspec_src( + ffi.Pointer git_refspec_src( ffi.Pointer refspec, ) { return _git_refspec_src( @@ -12083,16 +12088,16 @@ class Libgit2 { late final _git_refspec_srcPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_refspec_src'); late final _git_refspec_src = _git_refspec_srcPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the destination specifier /// /// @param refspec the refspec /// @return the refspec's destination specifier - ffi.Pointer git_refspec_dst( + ffi.Pointer git_refspec_dst( ffi.Pointer refspec, ) { return _git_refspec_dst( @@ -12102,16 +12107,16 @@ class Libgit2 { late final _git_refspec_dstPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_refspec_dst'); late final _git_refspec_dst = _git_refspec_dstPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the refspec's string /// /// @param refspec the refspec /// @returns the refspec's original string - ffi.Pointer git_refspec_string( + ffi.Pointer git_refspec_string( ffi.Pointer refspec, ) { return _git_refspec_string( @@ -12121,10 +12126,10 @@ class Libgit2 { late final _git_refspec_stringPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_refspec_string'); late final _git_refspec_string = _git_refspec_stringPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the force update setting /// @@ -12139,7 +12144,7 @@ class Libgit2 { } late final _git_refspec_forcePtr = - _lookup)>>( + _lookup)>>( 'git_refspec_force'); late final _git_refspec_force = _git_refspec_forcePtr .asFunction)>(); @@ -12169,7 +12174,7 @@ class Libgit2 { /// @return 1 if the refspec matches, 0 otherwise int git_refspec_src_matches( ffi.Pointer refspec, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_refspec_src_matches( refspec, @@ -12179,10 +12184,10 @@ class Libgit2 { late final _git_refspec_src_matchesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_refspec_src_matches'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_refspec_src_matches'); late final _git_refspec_src_matches = _git_refspec_src_matchesPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Check if a refspec's destination descriptor matches a reference /// @@ -12191,7 +12196,7 @@ class Libgit2 { /// @return 1 if the refspec matches, 0 otherwise int git_refspec_dst_matches( ffi.Pointer refspec, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_refspec_dst_matches( refspec, @@ -12201,10 +12206,10 @@ class Libgit2 { late final _git_refspec_dst_matchesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_refspec_dst_matches'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_refspec_dst_matches'); late final _git_refspec_dst_matches = _git_refspec_dst_matchesPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Transform a reference to its target following the refspec's rules /// @@ -12215,7 +12220,7 @@ class Libgit2 { int git_refspec_transform( ffi.Pointer out, ffi.Pointer spec, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_refspec_transform( out, @@ -12226,11 +12231,11 @@ class Libgit2 { late final _git_refspec_transformPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_refspec_transform'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_refspec_transform'); late final _git_refspec_transform = _git_refspec_transformPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Transform a target reference to its source reference following the refspec's rules /// @@ -12241,7 +12246,7 @@ class Libgit2 { int git_refspec_rtransform( ffi.Pointer out, ffi.Pointer spec, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_refspec_rtransform( out, @@ -12252,11 +12257,11 @@ class Libgit2 { late final _git_refspec_rtransformPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_refspec_rtransform'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_refspec_rtransform'); late final _git_refspec_rtransform = _git_refspec_rtransformPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Free a credential. /// @@ -12291,7 +12296,7 @@ class Libgit2 { } late final _git_credential_has_usernamePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_credential_has_username'); late final _git_credential_has_username = _git_credential_has_usernamePtr .asFunction)>(); @@ -12300,7 +12305,7 @@ class Libgit2 { /// /// @param cred object to check /// @return the credential username, or NULL if not applicable - ffi.Pointer git_credential_get_username( + ffi.Pointer git_credential_get_username( ffi.Pointer cred, ) { return _git_credential_get_username( @@ -12310,11 +12315,11 @@ class Libgit2 { late final _git_credential_get_usernamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_credential_get_username'); late final _git_credential_get_username = _git_credential_get_usernamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Create a new plain-text username and password credential object. /// The supplied credential parameter will be internally duplicated. @@ -12325,8 +12330,8 @@ class Libgit2 { /// @return 0 for success or an error code for failure int git_credential_userpass_plaintext_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer password, + ffi.Pointer username, + ffi.Pointer password, ) { return _git_credential_userpass_plaintext_new( out, @@ -12337,14 +12342,14 @@ class Libgit2 { late final _git_credential_userpass_plaintext_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>>('git_credential_userpass_plaintext_new'); + ffi.Pointer, + ffi.Pointer)>>('git_credential_userpass_plaintext_new'); late final _git_credential_userpass_plaintext_new = _git_credential_userpass_plaintext_newPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Create a "default" credential usable for Negotiate mechanisms like NTLM /// or Kerberos authentication. @@ -12361,7 +12366,7 @@ class Libgit2 { late final _git_credential_default_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>)>>( + ffi.Int32 Function(ffi.Pointer>)>>( 'git_credential_default_new'); late final _git_credential_default_new = _git_credential_default_newPtr .asFunction>)>(); @@ -12376,7 +12381,7 @@ class Libgit2 { /// @return 0 for success or an error code for failure int git_credential_username_new( ffi.Pointer> out, - ffi.Pointer username, + ffi.Pointer username, ) { return _git_credential_username_new( out, @@ -12386,12 +12391,12 @@ class Libgit2 { late final _git_credential_username_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_credential_username_new'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_credential_username_new'); late final _git_credential_username_new = _git_credential_username_newPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Create a new passphrase-protected ssh key credential object. /// The supplied credential parameter will be internally duplicated. @@ -12404,10 +12409,10 @@ class Libgit2 { /// @return 0 for success or an error code for failure int git_credential_ssh_key_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer publickey, - ffi.Pointer privatekey, - ffi.Pointer passphrase, + ffi.Pointer username, + ffi.Pointer publickey, + ffi.Pointer privatekey, + ffi.Pointer passphrase, ) { return _git_credential_ssh_key_new( out, @@ -12420,20 +12425,20 @@ class Libgit2 { late final _git_credential_ssh_key_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_credential_ssh_key_new'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_credential_ssh_key_new'); late final _git_credential_ssh_key_new = _git_credential_ssh_key_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Create a new ssh key credential object reading the keys from memory. /// @@ -12445,10 +12450,10 @@ class Libgit2 { /// @return 0 for success or an error code for failure int git_credential_ssh_key_memory_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer publickey, - ffi.Pointer privatekey, - ffi.Pointer passphrase, + ffi.Pointer username, + ffi.Pointer publickey, + ffi.Pointer privatekey, + ffi.Pointer passphrase, ) { return _git_credential_ssh_key_memory_new( out, @@ -12461,20 +12466,20 @@ class Libgit2 { late final _git_credential_ssh_key_memory_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_credential_ssh_key_memory_new'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_credential_ssh_key_memory_new'); late final _git_credential_ssh_key_memory_new = _git_credential_ssh_key_memory_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Create a new ssh keyboard-interactive based credential object. /// The supplied credential parameter will be internally duplicated. @@ -12486,7 +12491,7 @@ class Libgit2 { /// @return 0 for success or an error code for failure. int git_credential_ssh_interactive_new( ffi.Pointer> out, - ffi.Pointer username, + ffi.Pointer username, git_credential_ssh_interactive_cb prompt_callback, ffi.Pointer payload, ) { @@ -12500,16 +12505,16 @@ class Libgit2 { late final _git_credential_ssh_interactive_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, git_credential_ssh_interactive_cb, ffi.Pointer)>>('git_credential_ssh_interactive_new'); late final _git_credential_ssh_interactive_new = _git_credential_ssh_interactive_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, git_credential_ssh_interactive_cb, ffi.Pointer)>(); @@ -12521,7 +12526,7 @@ class Libgit2 { /// @return 0 for success or an error code for failure int git_credential_ssh_key_from_agent( ffi.Pointer> out, - ffi.Pointer username, + ffi.Pointer username, ) { return _git_credential_ssh_key_from_agent( out, @@ -12531,12 +12536,12 @@ class Libgit2 { late final _git_credential_ssh_key_from_agentPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_credential_ssh_key_from_agent'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_credential_ssh_key_from_agent'); late final _git_credential_ssh_key_from_agent = _git_credential_ssh_key_from_agentPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Create an ssh key credential with a custom signing function. /// @@ -12556,8 +12561,8 @@ class Libgit2 { /// @return 0 for success or an error code for failure int git_credential_ssh_custom_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer publickey, + ffi.Pointer username, + ffi.Pointer publickey, int publickey_len, git_credential_sign_cb sign_callback, ffi.Pointer payload, @@ -12574,19 +12579,19 @@ class Libgit2 { late final _git_credential_ssh_custom_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Size, + ffi.Pointer, + ffi.Pointer, + size_t, git_credential_sign_cb, ffi.Pointer)>>('git_credential_ssh_custom_new'); late final _git_credential_ssh_custom_new = _git_credential_ssh_custom_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, git_credential_sign_cb, ffi.Pointer)>(); @@ -12609,7 +12614,7 @@ class Libgit2 { late final _git_packbuilder_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_packbuilder_new'); late final _git_packbuilder_new = _git_packbuilder_newPtr.asFunction< int Function(ffi.Pointer>, @@ -12636,8 +12641,8 @@ class Libgit2 { late final _git_packbuilder_set_threadsPtr = _lookup< ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_packbuilder_set_threads'); + ffi.Uint32 Function(ffi.Pointer, + ffi.Uint32)>>('git_packbuilder_set_threads'); late final _git_packbuilder_set_threads = _git_packbuilder_set_threadsPtr .asFunction, int)>(); @@ -12654,7 +12659,7 @@ class Libgit2 { int git_packbuilder_insert( ffi.Pointer pb, ffi.Pointer id, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_packbuilder_insert( pb, @@ -12665,11 +12670,11 @@ class Libgit2 { late final _git_packbuilder_insertPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_packbuilder_insert'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_packbuilder_insert'); late final _git_packbuilder_insert = _git_packbuilder_insertPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Insert a root tree object /// @@ -12691,7 +12696,7 @@ class Libgit2 { late final _git_packbuilder_insert_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_packbuilder_insert_tree'); late final _git_packbuilder_insert_tree = _git_packbuilder_insert_treePtr.asFunction< @@ -12717,7 +12722,7 @@ class Libgit2 { late final _git_packbuilder_insert_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_packbuilder_insert_commit'); late final _git_packbuilder_insert_commit = _git_packbuilder_insert_commitPtr.asFunction< @@ -12744,7 +12749,7 @@ class Libgit2 { late final _git_packbuilder_insert_walkPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_packbuilder_insert_walk'); late final _git_packbuilder_insert_walk = _git_packbuilder_insert_walkPtr.asFunction< @@ -12762,7 +12767,7 @@ class Libgit2 { int git_packbuilder_insert_recur( ffi.Pointer pb, ffi.Pointer id, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_packbuilder_insert_recur( pb, @@ -12773,12 +12778,12 @@ class Libgit2 { late final _git_packbuilder_insert_recurPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_packbuilder_insert_recur'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_packbuilder_insert_recur'); late final _git_packbuilder_insert_recur = _git_packbuilder_insert_recurPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Write the contents of the packfile to an in-memory buffer /// @@ -12800,7 +12805,7 @@ class Libgit2 { late final _git_packbuilder_write_bufPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_packbuilder_write_buf'); late final _git_packbuilder_write_buf = _git_packbuilder_write_bufPtr.asFunction< @@ -12817,7 +12822,7 @@ class Libgit2 { /// @return 0 or an error code int git_packbuilder_write( ffi.Pointer pb, - ffi.Pointer path, + ffi.Pointer path, int mode, git_indexer_progress_cb progress_cb, ffi.Pointer progress_cb_payload, @@ -12833,14 +12838,14 @@ class Libgit2 { late final _git_packbuilder_writePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, + ffi.Pointer, + ffi.Uint32, git_indexer_progress_cb, ffi.Pointer)>>('git_packbuilder_write'); late final _git_packbuilder_write = _git_packbuilder_writePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, + int Function(ffi.Pointer, ffi.Pointer, int, git_indexer_progress_cb, ffi.Pointer)>(); /// Get the packfile's hash @@ -12873,7 +12878,7 @@ class Libgit2 { /// /// @param pb the packbuilder instance /// @return a NUL terminated string for the packfile name - ffi.Pointer git_packbuilder_name( + ffi.Pointer git_packbuilder_name( ffi.Pointer pb, ) { return _git_packbuilder_name( @@ -12883,10 +12888,10 @@ class Libgit2 { late final _git_packbuilder_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_packbuilder_name'); late final _git_packbuilder_name = _git_packbuilder_namePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Create the new pack and pass each object to the callback /// @@ -12908,7 +12913,7 @@ class Libgit2 { late final _git_packbuilder_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_packbuilder_foreach_cb, ffi.Pointer)>>('git_packbuilder_foreach'); @@ -12929,7 +12934,7 @@ class Libgit2 { } late final _git_packbuilder_object_countPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_packbuilder_object_count'); late final _git_packbuilder_object_count = _git_packbuilder_object_countPtr .asFunction)>(); @@ -12947,7 +12952,7 @@ class Libgit2 { } late final _git_packbuilder_writtenPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_packbuilder_written'); late final _git_packbuilder_written = _git_packbuilder_writtenPtr .asFunction)>(); @@ -12974,7 +12979,7 @@ class Libgit2 { late final _git_packbuilder_set_callbacksPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, git_packbuilder_progress, ffi.Pointer)>>('git_packbuilder_set_callbacks'); @@ -13020,8 +13025,8 @@ class Libgit2 { late final _git_proxy_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_proxy_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_proxy_options_init'); late final _git_proxy_options_init = _git_proxy_options_initPtr .asFunction, int)>(); @@ -13035,8 +13040,8 @@ class Libgit2 { int git_remote_create( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer url, + ffi.Pointer name, + ffi.Pointer url, ) { return _git_remote_create( out, @@ -13048,17 +13053,17 @@ class Libgit2 { late final _git_remote_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_remote_create'); + ffi.Pointer, + ffi.Pointer)>>('git_remote_create'); late final _git_remote_create = _git_remote_createPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Initialize git_remote_create_options structure /// @@ -13080,8 +13085,8 @@ class Libgit2 { late final _git_remote_create_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_remote_create_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_remote_create_options_init'); late final _git_remote_create_options_init = _git_remote_create_options_initPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -13098,7 +13103,7 @@ class Libgit2 { /// @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code int git_remote_create_with_opts( ffi.Pointer> out, - ffi.Pointer url, + ffi.Pointer url, ffi.Pointer opts, ) { return _git_remote_create_with_opts( @@ -13110,15 +13115,15 @@ class Libgit2 { late final _git_remote_create_with_optsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>( 'git_remote_create_with_opts'); late final _git_remote_create_with_opts = _git_remote_create_with_optsPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Add a remote with the provided fetch refspec (or default if NULL) to the repository's /// configuration. @@ -13132,9 +13137,9 @@ class Libgit2 { int git_remote_create_with_fetchspec( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer url, - ffi.Pointer fetch, + ffi.Pointer name, + ffi.Pointer url, + ffi.Pointer fetch, ) { return _git_remote_create_with_fetchspec( out, @@ -13147,20 +13152,20 @@ class Libgit2 { late final _git_remote_create_with_fetchspecPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_remote_create_with_fetchspec'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_remote_create_with_fetchspec'); late final _git_remote_create_with_fetchspec = _git_remote_create_with_fetchspecPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Create an anonymous remote /// @@ -13174,7 +13179,7 @@ class Libgit2 { int git_remote_create_anonymous( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer url, + ffi.Pointer url, ) { return _git_remote_create_anonymous( out, @@ -13185,14 +13190,14 @@ class Libgit2 { late final _git_remote_create_anonymousPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_remote_create_anonymous'); + ffi.Pointer)>>('git_remote_create_anonymous'); late final _git_remote_create_anonymous = _git_remote_create_anonymousPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Create a remote without a connected local repo /// @@ -13208,7 +13213,7 @@ class Libgit2 { /// @return 0 or an error code int git_remote_create_detached( ffi.Pointer> out, - ffi.Pointer url, + ffi.Pointer url, ) { return _git_remote_create_detached( out, @@ -13218,12 +13223,12 @@ class Libgit2 { late final _git_remote_create_detachedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_remote_create_detached'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_remote_create_detached'); late final _git_remote_create_detached = _git_remote_create_detachedPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer)>(); + ffi.Pointer>, ffi.Pointer)>(); /// Get the information for a particular remote /// @@ -13237,7 +13242,7 @@ class Libgit2 { int git_remote_lookup( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_remote_lookup( out, @@ -13248,13 +13253,13 @@ class Libgit2 { late final _git_remote_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_remote_lookup'); + ffi.Pointer)>>('git_remote_lookup'); late final _git_remote_lookup = _git_remote_lookupPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Create a copy of an existing remote. All internal strings are also /// duplicated. Callbacks are not duplicated. @@ -13276,7 +13281,7 @@ class Libgit2 { late final _git_remote_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_remote_dup'); late final _git_remote_dup = _git_remote_dupPtr.asFunction< int Function( @@ -13305,7 +13310,7 @@ class Libgit2 { /// /// @param remote the remote /// @return a pointer to the name or NULL for in-memory remotes - ffi.Pointer git_remote_name( + ffi.Pointer git_remote_name( ffi.Pointer remote, ) { return _git_remote_name( @@ -13315,10 +13320,10 @@ class Libgit2 { late final _git_remote_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_remote_name'); late final _git_remote_name = _git_remote_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the remote's url /// @@ -13328,7 +13333,7 @@ class Libgit2 { /// /// @param remote the remote /// @return a pointer to the url - ffi.Pointer git_remote_url( + ffi.Pointer git_remote_url( ffi.Pointer remote, ) { return _git_remote_url( @@ -13338,10 +13343,10 @@ class Libgit2 { late final _git_remote_urlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_remote_url'); late final _git_remote_url = _git_remote_urlPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the remote's url for pushing. /// @@ -13351,7 +13356,7 @@ class Libgit2 { /// /// @param remote the remote /// @return a pointer to the url or NULL if no special url for pushing is set - ffi.Pointer git_remote_pushurl( + ffi.Pointer git_remote_pushurl( ffi.Pointer remote, ) { return _git_remote_pushurl( @@ -13361,10 +13366,10 @@ class Libgit2 { late final _git_remote_pushurlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_remote_pushurl'); late final _git_remote_pushurl = _git_remote_pushurlPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Set the remote's url in the configuration /// @@ -13377,8 +13382,8 @@ class Libgit2 { /// @return 0 or an error value int git_remote_set_url( ffi.Pointer repo, - ffi.Pointer remote, - ffi.Pointer url, + ffi.Pointer remote, + ffi.Pointer url, ) { return _git_remote_set_url( repo, @@ -13389,11 +13394,11 @@ class Libgit2 { late final _git_remote_set_urlPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_remote_set_url'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_remote_set_url'); late final _git_remote_set_url = _git_remote_set_urlPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Set the remote's url for pushing in the configuration. /// @@ -13407,8 +13412,8 @@ class Libgit2 { /// @return 0, or an error code int git_remote_set_pushurl( ffi.Pointer repo, - ffi.Pointer remote, - ffi.Pointer url, + ffi.Pointer remote, + ffi.Pointer url, ) { return _git_remote_set_pushurl( repo, @@ -13419,11 +13424,11 @@ class Libgit2 { late final _git_remote_set_pushurlPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_remote_set_pushurl'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_remote_set_pushurl'); late final _git_remote_set_pushurl = _git_remote_set_pushurlPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Set the url for this particular url instance. The URL in the /// configuration will be ignored, and will not be changed. @@ -13433,7 +13438,7 @@ class Libgit2 { /// @return 0 or an error value int git_remote_set_instance_url( ffi.Pointer remote, - ffi.Pointer url, + ffi.Pointer url, ) { return _git_remote_set_instance_url( remote, @@ -13443,11 +13448,11 @@ class Libgit2 { late final _git_remote_set_instance_urlPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_remote_set_instance_url'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_remote_set_instance_url'); late final _git_remote_set_instance_url = _git_remote_set_instance_urlPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Set the push url for this particular url instance. The URL in the /// configuration will be ignored, and will not be changed. @@ -13457,7 +13462,7 @@ class Libgit2 { /// @return 0 or an error value int git_remote_set_instance_pushurl( ffi.Pointer remote, - ffi.Pointer url, + ffi.Pointer url, ) { return _git_remote_set_instance_pushurl( remote, @@ -13467,11 +13472,11 @@ class Libgit2 { late final _git_remote_set_instance_pushurlPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_remote_set_instance_pushurl'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_remote_set_instance_pushurl'); late final _git_remote_set_instance_pushurl = _git_remote_set_instance_pushurlPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Add a fetch refspec to the remote's configuration /// @@ -13484,8 +13489,8 @@ class Libgit2 { /// @return 0, GIT_EINVALIDSPEC if refspec is invalid or an error value int git_remote_add_fetch( ffi.Pointer repo, - ffi.Pointer remote, - ffi.Pointer refspec, + ffi.Pointer remote, + ffi.Pointer refspec, ) { return _git_remote_add_fetch( repo, @@ -13496,11 +13501,11 @@ class Libgit2 { late final _git_remote_add_fetchPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_remote_add_fetch'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_remote_add_fetch'); late final _git_remote_add_fetch = _git_remote_add_fetchPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Get the remote's list of fetch refspecs /// @@ -13522,7 +13527,7 @@ class Libgit2 { late final _git_remote_get_fetch_refspecsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_remote_get_fetch_refspecs'); late final _git_remote_get_fetch_refspecs = _git_remote_get_fetch_refspecsPtr.asFunction< @@ -13539,8 +13544,8 @@ class Libgit2 { /// @return 0, GIT_EINVALIDSPEC if refspec is invalid or an error value int git_remote_add_push( ffi.Pointer repo, - ffi.Pointer remote, - ffi.Pointer refspec, + ffi.Pointer remote, + ffi.Pointer refspec, ) { return _git_remote_add_push( repo, @@ -13551,11 +13556,11 @@ class Libgit2 { late final _git_remote_add_pushPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_remote_add_push'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_remote_add_push'); late final _git_remote_add_push = _git_remote_add_pushPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Get the remote's list of push refspecs /// @@ -13577,7 +13582,7 @@ class Libgit2 { late final _git_remote_get_push_refspecsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_remote_get_push_refspecs'); late final _git_remote_get_push_refspecs = _git_remote_get_push_refspecsPtr.asFunction< @@ -13596,7 +13601,7 @@ class Libgit2 { } late final _git_remote_refspec_countPtr = - _lookup)>>( + _lookup)>>( 'git_remote_refspec_count'); late final _git_remote_refspec_count = _git_remote_refspec_countPtr .asFunction)>(); @@ -13619,7 +13624,7 @@ class Libgit2 { late final _git_remote_get_refspecPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('git_remote_get_refspec'); + ffi.Pointer, size_t)>>('git_remote_get_refspec'); late final _git_remote_get_refspec = _git_remote_get_refspecPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -13643,7 +13648,7 @@ class Libgit2 { /// @return 0 on success, or an error code int git_remote_ls( ffi.Pointer>> out, - ffi.Pointer size, + ffi.Pointer size, ffi.Pointer remote, ) { return _git_remote_ls( @@ -13655,13 +13660,13 @@ class Libgit2 { late final _git_remote_lsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>>, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_remote_ls'); late final _git_remote_ls = _git_remote_lsPtr.asFunction< int Function(ffi.Pointer>>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Check whether the remote is connected /// @@ -13679,7 +13684,7 @@ class Libgit2 { } late final _git_remote_connectedPtr = - _lookup)>>( + _lookup)>>( 'git_remote_connected'); late final _git_remote_connected = _git_remote_connectedPtr .asFunction)>(); @@ -13700,7 +13705,7 @@ class Libgit2 { } late final _git_remote_stopPtr = - _lookup)>>( + _lookup)>>( 'git_remote_stop'); late final _git_remote_stop = _git_remote_stopPtr.asFunction)>(); @@ -13720,7 +13725,7 @@ class Libgit2 { } late final _git_remote_disconnectPtr = - _lookup)>>( + _lookup)>>( 'git_remote_disconnect'); late final _git_remote_disconnect = _git_remote_disconnectPtr .asFunction)>(); @@ -13764,7 +13769,7 @@ class Libgit2 { late final _git_remote_listPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_remote_list'); late final _git_remote_list = _git_remote_listPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -13787,8 +13792,8 @@ class Libgit2 { late final _git_remote_init_callbacksPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_remote_init_callbacks'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_remote_init_callbacks'); late final _git_remote_init_callbacks = _git_remote_init_callbacksPtr .asFunction, int)>(); @@ -13812,8 +13817,8 @@ class Libgit2 { late final _git_fetch_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_fetch_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_fetch_options_init'); late final _git_fetch_options_init = _git_fetch_options_initPtr .asFunction, int)>(); @@ -13837,8 +13842,8 @@ class Libgit2 { late final _git_push_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_push_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_push_options_init'); late final _git_push_options_init = _git_push_options_initPtr .asFunction, int)>(); @@ -13863,8 +13868,8 @@ class Libgit2 { late final _git_remote_connect_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_remote_connect_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_remote_connect_options_init'); late final _git_remote_connect_options_init = _git_remote_connect_options_initPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -13900,7 +13905,7 @@ class Libgit2 { late final _git_remote_connectPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Int32, ffi.Pointer, @@ -13944,7 +13949,7 @@ class Libgit2 { late final _git_remote_connect_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int32, + ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Pointer)>>( 'git_remote_connect_ext'); late final _git_remote_connect_ext = _git_remote_connect_extPtr.asFunction< @@ -13983,7 +13988,7 @@ class Libgit2 { late final _git_remote_downloadPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_remote_download'); late final _git_remote_download = _git_remote_downloadPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -14018,7 +14023,7 @@ class Libgit2 { late final _git_remote_uploadPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_remote_upload'); late final _git_remote_upload = _git_remote_uploadPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -14044,7 +14049,7 @@ class Libgit2 { ffi.Pointer callbacks, int update_fetchhead, int download_tags, - ffi.Pointer reflog_message, + ffi.Pointer reflog_message, ) { return _git_remote_update_tips( remote, @@ -14057,15 +14062,15 @@ class Libgit2 { late final _git_remote_update_tipsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Int, ffi.Int32, - ffi.Pointer)>>('git_remote_update_tips'); + ffi.Int32, + ffi.Pointer)>>('git_remote_update_tips'); late final _git_remote_update_tips = _git_remote_update_tipsPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - int, int, ffi.Pointer)>(); + int, int, ffi.Pointer)>(); /// Download new data and update tips. /// @@ -14087,7 +14092,7 @@ class Libgit2 { ffi.Pointer remote, ffi.Pointer refspecs, ffi.Pointer opts, - ffi.Pointer reflog_message, + ffi.Pointer reflog_message, ) { return _git_remote_fetch( remote, @@ -14099,14 +14104,14 @@ class Libgit2 { late final _git_remote_fetchPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_remote_fetch'); + ffi.Pointer)>>('git_remote_fetch'); late final _git_remote_fetch = _git_remote_fetchPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Prune tracking refs that are no longer present on remote. /// @@ -14128,7 +14133,7 @@ class Libgit2 { late final _git_remote_prunePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_remote_prune'); late final _git_remote_prune = _git_remote_prunePtr.asFunction< int Function( @@ -14159,7 +14164,7 @@ class Libgit2 { late final _git_remote_pushPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_remote_push'); late final _git_remote_push = _git_remote_pushPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -14210,7 +14215,7 @@ class Libgit2 { /// @return 0, or an error code. int git_remote_set_autotag( ffi.Pointer repo, - ffi.Pointer remote, + ffi.Pointer remote, int value, ) { return _git_remote_set_autotag( @@ -14222,10 +14227,10 @@ class Libgit2 { late final _git_remote_set_autotagPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_remote_set_autotag'); late final _git_remote_set_autotag = _git_remote_set_autotagPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Retrieve the ref-prune setting /// @@ -14240,7 +14245,7 @@ class Libgit2 { } late final _git_remote_prune_refsPtr = - _lookup)>>( + _lookup)>>( 'git_remote_prune_refs'); late final _git_remote_prune_refs = _git_remote_prune_refsPtr .asFunction)>(); @@ -14266,8 +14271,8 @@ class Libgit2 { int git_remote_rename( ffi.Pointer problems, ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer new_name, + ffi.Pointer name, + ffi.Pointer new_name, ) { return _git_remote_rename( problems, @@ -14279,14 +14284,14 @@ class Libgit2 { late final _git_remote_renamePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_remote_rename'); + ffi.Pointer, + ffi.Pointer)>>('git_remote_rename'); late final _git_remote_rename = _git_remote_renamePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Ensure the remote name is well-formed. /// @@ -14294,8 +14299,8 @@ class Libgit2 { /// @param remote_name name to be checked. /// @return 0 on success or an error code int git_remote_name_is_valid( - ffi.Pointer valid, - ffi.Pointer remote_name, + ffi.Pointer valid, + ffi.Pointer remote_name, ) { return _git_remote_name_is_valid( valid, @@ -14305,10 +14310,11 @@ class Libgit2 { late final _git_remote_name_is_validPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_remote_name_is_valid'); - late final _git_remote_name_is_valid = _git_remote_name_is_validPtr - .asFunction, ffi.Pointer)>(); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_remote_name_is_valid'); + late final _git_remote_name_is_valid = + _git_remote_name_is_validPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// Delete an existing persisted remote. /// @@ -14320,7 +14326,7 @@ class Libgit2 { /// @return 0 on success, or an error code. int git_remote_delete( ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_remote_delete( repo, @@ -14330,10 +14336,10 @@ class Libgit2 { late final _git_remote_deletePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_remote_delete'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_remote_delete'); late final _git_remote_delete = _git_remote_deletePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Retrieve the name of the remote's default branch /// @@ -14361,7 +14367,7 @@ class Libgit2 { late final _git_remote_default_branchPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_remote_default_branch'); late final _git_remote_default_branch = _git_remote_default_branchPtr.asFunction< @@ -14387,8 +14393,8 @@ class Libgit2 { late final _git_clone_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_clone_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_clone_options_init'); late final _git_clone_options_init = _git_clone_options_initPtr .asFunction, int)>(); @@ -14408,8 +14414,8 @@ class Libgit2 { /// `git_error_last` for a detailed error message) int git_clone( ffi.Pointer> out, - ffi.Pointer url, - ffi.Pointer local_path, + ffi.Pointer url, + ffi.Pointer local_path, ffi.Pointer options, ) { return _git_clone( @@ -14422,16 +14428,16 @@ class Libgit2 { late final _git_clonePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_clone'); late final _git_clone = _git_clonePtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Lookup a commit object from a repository. @@ -14458,7 +14464,7 @@ class Libgit2 { late final _git_commit_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_commit_lookup'); @@ -14496,11 +14502,11 @@ class Libgit2 { late final _git_commit_lookup_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_commit_lookup_prefix'); + size_t)>>('git_commit_lookup_prefix'); late final _git_commit_lookup_prefix = _git_commit_lookup_prefixPtr.asFunction< int Function(ffi.Pointer>, @@ -14575,7 +14581,7 @@ class Libgit2 { /// /// @param commit a previously loaded commit. /// @return NULL, or the encoding - ffi.Pointer git_commit_message_encoding( + ffi.Pointer git_commit_message_encoding( ffi.Pointer commit, ) { return _git_commit_message_encoding( @@ -14585,10 +14591,10 @@ class Libgit2 { late final _git_commit_message_encodingPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_commit_message_encoding'); late final _git_commit_message_encoding = _git_commit_message_encodingPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the full message of a commit. /// @@ -14597,7 +14603,7 @@ class Libgit2 { /// /// @param commit a previously loaded commit. /// @return the message of a commit - ffi.Pointer git_commit_message( + ffi.Pointer git_commit_message( ffi.Pointer commit, ) { return _git_commit_message( @@ -14607,16 +14613,16 @@ class Libgit2 { late final _git_commit_messagePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_commit_message'); late final _git_commit_message = _git_commit_messagePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the full raw message of a commit. /// /// @param commit a previously loaded commit. /// @return the raw message of a commit - ffi.Pointer git_commit_message_raw( + ffi.Pointer git_commit_message_raw( ffi.Pointer commit, ) { return _git_commit_message_raw( @@ -14626,10 +14632,10 @@ class Libgit2 { late final _git_commit_message_rawPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_commit_message_raw'); late final _git_commit_message_raw = _git_commit_message_rawPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the short "summary" of the git commit message. /// @@ -14638,7 +14644,7 @@ class Libgit2 { /// /// @param commit a previously loaded commit. /// @return the summary of a commit or NULL on error - ffi.Pointer git_commit_summary( + ffi.Pointer git_commit_summary( ffi.Pointer commit, ) { return _git_commit_summary( @@ -14648,10 +14654,10 @@ class Libgit2 { late final _git_commit_summaryPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_commit_summary'); late final _git_commit_summary = _git_commit_summaryPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the long "body" of the git commit message. /// @@ -14662,7 +14668,7 @@ class Libgit2 { /// @param commit a previously loaded commit. /// @return the body of a commit or NULL when no the message only /// consists of a summary - ffi.Pointer git_commit_body( + ffi.Pointer git_commit_body( ffi.Pointer commit, ) { return _git_commit_body( @@ -14672,10 +14678,10 @@ class Libgit2 { late final _git_commit_bodyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_commit_body'); late final _git_commit_body = _git_commit_bodyPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the commit time (i.e. committer time) of a commit. /// @@ -14708,7 +14714,7 @@ class Libgit2 { } late final _git_commit_time_offsetPtr = - _lookup)>>( + _lookup)>>( 'git_commit_time_offset'); late final _git_commit_time_offset = _git_commit_time_offsetPtr .asFunction)>(); @@ -14774,7 +14780,7 @@ class Libgit2 { late final _git_commit_committer_with_mailmapPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_commit_committer_with_mailmap'); @@ -14806,7 +14812,7 @@ class Libgit2 { late final _git_commit_author_with_mailmapPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_commit_author_with_mailmap'); @@ -14819,7 +14825,7 @@ class Libgit2 { /// /// @param commit a previously loaded commit /// @return the header text of the commit - ffi.Pointer git_commit_raw_header( + ffi.Pointer git_commit_raw_header( ffi.Pointer commit, ) { return _git_commit_raw_header( @@ -14829,10 +14835,10 @@ class Libgit2 { late final _git_commit_raw_headerPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_commit_raw_header'); late final _git_commit_raw_header = _git_commit_raw_headerPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the tree pointed to by a commit. /// @@ -14851,7 +14857,7 @@ class Libgit2 { late final _git_commit_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_commit_tree'); late final _git_commit_tree = _git_commit_treePtr.asFunction< int Function( @@ -14890,10 +14896,9 @@ class Libgit2 { ); } - late final _git_commit_parentcountPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function( - ffi.Pointer)>>('git_commit_parentcount'); + late final _git_commit_parentcountPtr = + _lookup)>>( + 'git_commit_parentcount'); late final _git_commit_parentcount = _git_commit_parentcountPtr .asFunction)>(); @@ -14917,8 +14922,8 @@ class Libgit2 { late final _git_commit_parentPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.UnsignedInt)>>('git_commit_parent'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, ffi.Uint32)>>('git_commit_parent'); late final _git_commit_parent = _git_commit_parentPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, int)>(); @@ -14942,8 +14947,8 @@ class Libgit2 { late final _git_commit_parent_idPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_commit_parent_id'); + ffi.Pointer Function( + ffi.Pointer, ffi.Uint32)>>('git_commit_parent_id'); late final _git_commit_parent_id = _git_commit_parent_idPtr.asFunction< ffi.Pointer Function(ffi.Pointer, int)>(); @@ -14973,10 +14978,10 @@ class Libgit2 { late final _git_commit_nth_gen_ancestorPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.UnsignedInt)>>('git_commit_nth_gen_ancestor'); + ffi.Uint32)>>('git_commit_nth_gen_ancestor'); late final _git_commit_nth_gen_ancestor = _git_commit_nth_gen_ancestorPtr.asFunction< int Function(ffi.Pointer>, @@ -14993,7 +14998,7 @@ class Libgit2 { int git_commit_header_field( ffi.Pointer out, ffi.Pointer commit, - ffi.Pointer field, + ffi.Pointer field, ) { return _git_commit_header_field( out, @@ -15004,11 +15009,11 @@ class Libgit2 { late final _git_commit_header_fieldPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_commit_header_field'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_commit_header_field'); late final _git_commit_header_field = _git_commit_header_fieldPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Extract the signature from a commit /// @@ -15031,7 +15036,7 @@ class Libgit2 { ffi.Pointer signed_data, ffi.Pointer repo, ffi.Pointer commit_id, - ffi.Pointer field, + ffi.Pointer field, ) { return _git_commit_extract_signature( signature, @@ -15044,12 +15049,12 @@ class Libgit2 { late final _git_commit_extract_signaturePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_commit_extract_signature'); + ffi.Pointer)>>('git_commit_extract_signature'); late final _git_commit_extract_signature = _git_commit_extract_signaturePtr.asFunction< int Function( @@ -15057,7 +15062,7 @@ class Libgit2 { ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Create new commit in the repository from a list of `git_object` pointers /// @@ -15104,11 +15109,11 @@ class Libgit2 { int git_commit_create( ffi.Pointer id, ffi.Pointer repo, - ffi.Pointer update_ref, + ffi.Pointer update_ref, ffi.Pointer author, ffi.Pointer committer, - ffi.Pointer message_encoding, - ffi.Pointer message, + ffi.Pointer message_encoding, + ffi.Pointer message, ffi.Pointer tree, int parent_count, ffi.Pointer> parents, @@ -15129,26 +15134,26 @@ class Libgit2 { late final _git_commit_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Pointer>)>>('git_commit_create'); late final _git_commit_create = _git_commit_createPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ffi.Pointer>)>(); @@ -15168,11 +15173,11 @@ class Libgit2 { int git_commit_create_v( ffi.Pointer id, ffi.Pointer repo, - ffi.Pointer update_ref, + ffi.Pointer update_ref, ffi.Pointer author, ffi.Pointer committer, - ffi.Pointer message_encoding, - ffi.Pointer message, + ffi.Pointer message_encoding, + ffi.Pointer message, ffi.Pointer tree, int parent_count, ) { @@ -15191,25 +15196,25 @@ class Libgit2 { late final _git_commit_create_vPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_commit_create_v'); + size_t)>>('git_commit_create_v'); late final _git_commit_create_v = _git_commit_create_vPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); @@ -15235,11 +15240,11 @@ class Libgit2 { int git_commit_amend( ffi.Pointer id, ffi.Pointer commit_to_amend, - ffi.Pointer update_ref, + ffi.Pointer update_ref, ffi.Pointer author, ffi.Pointer committer, - ffi.Pointer message_encoding, - ffi.Pointer message, + ffi.Pointer message_encoding, + ffi.Pointer message, ffi.Pointer tree, ) { return _git_commit_amend( @@ -15256,24 +15261,24 @@ class Libgit2 { late final _git_commit_amendPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_commit_amend'); late final _git_commit_amend = _git_commit_amendPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Create a commit and write it into a buffer @@ -15314,8 +15319,8 @@ class Libgit2 { ffi.Pointer repo, ffi.Pointer author, ffi.Pointer committer, - ffi.Pointer message_encoding, - ffi.Pointer message, + ffi.Pointer message_encoding, + ffi.Pointer message, ffi.Pointer tree, int parent_count, ffi.Pointer> parents, @@ -15335,15 +15340,15 @@ class Libgit2 { late final _git_commit_create_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Pointer>)>>( 'git_commit_create_buffer'); late final _git_commit_create_buffer = @@ -15353,8 +15358,8 @@ class Libgit2 { ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, ffi.Pointer>)>(); @@ -15376,9 +15381,9 @@ class Libgit2 { int git_commit_create_with_signature( ffi.Pointer out, ffi.Pointer repo, - ffi.Pointer commit_content, - ffi.Pointer signature, - ffi.Pointer signature_field, + ffi.Pointer commit_content, + ffi.Pointer signature, + ffi.Pointer signature_field, ) { return _git_commit_create_with_signature( out, @@ -15391,20 +15396,20 @@ class Libgit2 { late final _git_commit_create_with_signaturePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_commit_create_with_signature'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_commit_create_with_signature'); late final _git_commit_create_with_signature = _git_commit_create_with_signaturePtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Create an in-memory copy of a commit. The copy must be explicitly /// free'd or it will leak. @@ -15424,7 +15429,7 @@ class Libgit2 { late final _git_commit_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_commit_dup'); late final _git_commit_dup = _git_commit_dupPtr.asFunction< int Function( @@ -15458,7 +15463,7 @@ class Libgit2 { /// global configuration file. /// /// This method will not guess the path to the xdg compatible - /// config file (`.config/git/config`). + /// config file (.config/git/config). /// /// @param out Pointer to a user-allocated git_buf in which to store the path /// @return 0 if a global configuration file has been found. Its path will be stored in `out`. @@ -15471,7 +15476,7 @@ class Libgit2 { } late final _git_config_find_globalPtr = - _lookup)>>( + _lookup)>>( 'git_config_find_global'); late final _git_config_find_global = _git_config_find_globalPtr .asFunction)>(); @@ -15498,15 +15503,15 @@ class Libgit2 { } late final _git_config_find_xdgPtr = - _lookup)>>( + _lookup)>>( 'git_config_find_xdg'); late final _git_config_find_xdg = _git_config_find_xdgPtr.asFunction)>(); /// Locate the path to the system configuration file /// - /// If `/etc/gitconfig` doesn't exist, it will look for - /// `%PROGRAMFILES%\Git\etc\gitconfig`. + /// If /etc/gitconfig doesn't exist, it will look for + /// %PROGRAMFILES%\Git\etc\gitconfig. /// /// @param out Pointer to a user-allocated git_buf in which to store the path /// @return 0 if a system configuration file has been @@ -15520,14 +15525,14 @@ class Libgit2 { } late final _git_config_find_systemPtr = - _lookup)>>( + _lookup)>>( 'git_config_find_system'); late final _git_config_find_system = _git_config_find_systemPtr .asFunction)>(); /// Locate the path to the configuration file in ProgramData /// - /// Look for the file in `%PROGRAMDATA%\Git\config` used by portable git. + /// Look for the file in %PROGRAMDATA%\Git\config used by portable git. /// /// @param out Pointer to a user-allocated git_buf in which to store the path /// @return 0 if a ProgramData configuration file has been @@ -15541,7 +15546,7 @@ class Libgit2 { } late final _git_config_find_programdataPtr = - _lookup)>>( + _lookup)>>( 'git_config_find_programdata'); late final _git_config_find_programdata = _git_config_find_programdataPtr .asFunction)>(); @@ -15564,7 +15569,7 @@ class Libgit2 { late final _git_config_open_defaultPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>)>>( + ffi.Int32 Function(ffi.Pointer>)>>( 'git_config_open_default'); late final _git_config_open_default = _git_config_open_defaultPtr .asFunction>)>(); @@ -15586,7 +15591,7 @@ class Libgit2 { late final _git_config_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>)>>('git_config_new'); late final _git_config_new = _git_config_newPtr .asFunction>)>(); @@ -15618,7 +15623,7 @@ class Libgit2 { /// GIT_ENOTFOUND when the file doesn't exist or error code int git_config_add_file_ondisk( ffi.Pointer cfg, - ffi.Pointer path, + ffi.Pointer path, int level, ffi.Pointer repo, int force, @@ -15634,15 +15639,15 @@ class Libgit2 { late final _git_config_add_file_ondiskPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Int32, ffi.Pointer, - ffi.Int)>>('git_config_add_file_ondisk'); + ffi.Int32)>>('git_config_add_file_ondisk'); late final _git_config_add_file_ondisk = _git_config_add_file_ondiskPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, + int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, int)>(); /// Create a new config instance containing a single on-disk file @@ -15657,7 +15662,7 @@ class Libgit2 { /// @return 0 on success, or an error code int git_config_open_ondisk( ffi.Pointer> out, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_config_open_ondisk( out, @@ -15667,11 +15672,11 @@ class Libgit2 { late final _git_config_open_ondiskPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_config_open_ondisk'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_config_open_ondisk'); late final _git_config_open_ondisk = _git_config_open_ondiskPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer)>(); + ffi.Pointer>, ffi.Pointer)>(); /// Build a single-level focused config object from a multi-level one. /// @@ -15701,7 +15706,7 @@ class Libgit2 { late final _git_config_open_levelPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer, ffi.Int32)>>('git_config_open_level'); late final _git_config_open_level = _git_config_open_levelPtr.asFunction< int Function(ffi.Pointer>, @@ -15730,7 +15735,7 @@ class Libgit2 { late final _git_config_open_globalPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_config_open_global'); late final _git_config_open_global = _git_config_open_globalPtr.asFunction< int Function( @@ -15760,7 +15765,7 @@ class Libgit2 { late final _git_config_snapshotPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_config_snapshot'); late final _git_config_snapshot = _git_config_snapshotPtr.asFunction< int Function( @@ -15794,7 +15799,7 @@ class Libgit2 { int git_config_get_entry( ffi.Pointer> out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_get_entry( out, @@ -15805,13 +15810,13 @@ class Libgit2 { late final _git_config_get_entryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_config_get_entry'); + ffi.Pointer)>>('git_config_get_entry'); late final _git_config_get_entry = _git_config_get_entryPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Get the value of an integer config variable. /// @@ -15826,7 +15831,7 @@ class Libgit2 { int git_config_get_int32( ffi.Pointer out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_get_int32( out, @@ -15837,11 +15842,11 @@ class Libgit2 { late final _git_config_get_int32Ptr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_config_get_int32'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_config_get_int32'); late final _git_config_get_int32 = _git_config_get_int32Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Get the value of a long integer config variable. /// @@ -15856,7 +15861,7 @@ class Libgit2 { int git_config_get_int64( ffi.Pointer out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_get_int64( out, @@ -15867,11 +15872,11 @@ class Libgit2 { late final _git_config_get_int64Ptr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_config_get_int64'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_config_get_int64'); late final _git_config_get_int64 = _git_config_get_int64Ptr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Get the value of a boolean config variable. /// @@ -15887,9 +15892,9 @@ class Libgit2 { /// @param name the variable's name /// @return 0 or an error code int git_config_get_bool( - ffi.Pointer out, + ffi.Pointer out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_get_bool( out, @@ -15900,11 +15905,11 @@ class Libgit2 { late final _git_config_get_boolPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_config_get_bool'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_config_get_bool'); late final _git_config_get_bool = _git_config_get_boolPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Get the value of a path config variable. /// @@ -15923,7 +15928,7 @@ class Libgit2 { int git_config_get_path( ffi.Pointer out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_get_path( out, @@ -15934,11 +15939,11 @@ class Libgit2 { late final _git_config_get_pathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_config_get_path'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_config_get_path'); late final _git_config_get_path = _git_config_get_pathPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Get the value of a string config variable. /// @@ -15955,9 +15960,9 @@ class Libgit2 { /// @param name the variable's name /// @return 0 or an error code int git_config_get_string( - ffi.Pointer> out, + ffi.Pointer> out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_get_string( out, @@ -15968,13 +15973,13 @@ class Libgit2 { late final _git_config_get_stringPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, + ffi.Int32 Function( + ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_config_get_string'); + ffi.Pointer)>>('git_config_get_string'); late final _git_config_get_string = _git_config_get_stringPtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer>, ffi.Pointer, + ffi.Pointer)>(); /// Get the value of a string config variable. /// @@ -15991,7 +15996,7 @@ class Libgit2 { int git_config_get_string_buf( ffi.Pointer out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_get_string_buf( out, @@ -16002,12 +16007,12 @@ class Libgit2 { late final _git_config_get_string_bufPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_config_get_string_buf'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_config_get_string_buf'); late final _git_config_get_string_buf = _git_config_get_string_bufPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Get each value of a multivar in a foreach callback /// @@ -16026,8 +16031,8 @@ class Libgit2 { /// @return 0 or an error code. int git_config_get_multivar_foreach( ffi.Pointer cfg, - ffi.Pointer name, - ffi.Pointer regexp, + ffi.Pointer name, + ffi.Pointer regexp, git_config_foreach_cb callback, ffi.Pointer payload, ) { @@ -16042,18 +16047,18 @@ class Libgit2 { late final _git_config_get_multivar_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, git_config_foreach_cb, ffi.Pointer)>>('git_config_get_multivar_foreach'); late final _git_config_get_multivar_foreach = _git_config_get_multivar_foreachPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, git_config_foreach_cb, ffi.Pointer)>(); @@ -16072,8 +16077,8 @@ class Libgit2 { int git_config_multivar_iterator_new( ffi.Pointer> out, ffi.Pointer cfg, - ffi.Pointer name, - ffi.Pointer regexp, + ffi.Pointer name, + ffi.Pointer regexp, ) { return _git_config_multivar_iterator_new( out, @@ -16085,23 +16090,23 @@ class Libgit2 { late final _git_config_multivar_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_config_multivar_iterator_new'); + ffi.Pointer, + ffi.Pointer)>>('git_config_multivar_iterator_new'); late final _git_config_multivar_iterator_new = _git_config_multivar_iterator_newPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Return the current entry and advance the iterator /// - /// The pointers returned by this function are valid until the next call - /// to `git_config_next` or until the iterator is freed. + /// The pointers returned by this function are valid until the iterator + /// is freed. /// /// @param entry pointer to store the entry /// @param iter the iterator @@ -16118,7 +16123,7 @@ class Libgit2 { late final _git_config_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_config_next'); late final _git_config_next = _git_config_nextPtr.asFunction< int Function(ffi.Pointer>, @@ -16151,7 +16156,7 @@ class Libgit2 { /// @return 0 or an error code int git_config_set_int32( ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, int value, ) { return _git_config_set_int32( @@ -16163,10 +16168,10 @@ class Libgit2 { late final _git_config_set_int32Ptr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_config_set_int32'); late final _git_config_set_int32 = _git_config_set_int32Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Set the value of a long integer config variable in the config file /// with the highest level (usually the local one). @@ -16177,7 +16182,7 @@ class Libgit2 { /// @return 0 or an error code int git_config_set_int64( ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, int value, ) { return _git_config_set_int64( @@ -16189,10 +16194,10 @@ class Libgit2 { late final _git_config_set_int64Ptr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int64)>>('git_config_set_int64'); late final _git_config_set_int64 = _git_config_set_int64Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Set the value of a boolean config variable in the config file /// with the highest level (usually the local one). @@ -16203,7 +16208,7 @@ class Libgit2 { /// @return 0 or an error code int git_config_set_bool( ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, int value, ) { return _git_config_set_bool( @@ -16215,10 +16220,10 @@ class Libgit2 { late final _git_config_set_boolPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_config_set_bool'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('git_config_set_bool'); late final _git_config_set_bool = _git_config_set_boolPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Set the value of a string config variable in the config file /// with the highest level (usually the local one). @@ -16232,8 +16237,8 @@ class Libgit2 { /// @return 0 or an error code int git_config_set_string( ffi.Pointer cfg, - ffi.Pointer name, - ffi.Pointer value, + ffi.Pointer name, + ffi.Pointer value, ) { return _git_config_set_string( cfg, @@ -16244,11 +16249,11 @@ class Libgit2 { late final _git_config_set_stringPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_config_set_string'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_config_set_string'); late final _git_config_set_string = _git_config_set_stringPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Set a multivar in the local config file. /// @@ -16261,9 +16266,9 @@ class Libgit2 { /// @return 0 or an error code. int git_config_set_multivar( ffi.Pointer cfg, - ffi.Pointer name, - ffi.Pointer regexp, - ffi.Pointer value, + ffi.Pointer name, + ffi.Pointer regexp, + ffi.Pointer value, ) { return _git_config_set_multivar( cfg, @@ -16275,14 +16280,14 @@ class Libgit2 { late final _git_config_set_multivarPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_config_set_multivar'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_config_set_multivar'); late final _git_config_set_multivar = _git_config_set_multivarPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Delete a config variable from the config file /// with the highest level (usually the local one). @@ -16292,7 +16297,7 @@ class Libgit2 { /// @return 0 or an error code. int git_config_delete_entry( ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_config_delete_entry( cfg, @@ -16302,10 +16307,10 @@ class Libgit2 { late final _git_config_delete_entryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_config_delete_entry'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_config_delete_entry'); late final _git_config_delete_entry = _git_config_delete_entryPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Deletes one or several entries from a multivar in the local config file. /// @@ -16318,8 +16323,8 @@ class Libgit2 { /// @return 0 or an error code int git_config_delete_multivar( ffi.Pointer cfg, - ffi.Pointer name, - ffi.Pointer regexp, + ffi.Pointer name, + ffi.Pointer regexp, ) { return _git_config_delete_multivar( cfg, @@ -16330,12 +16335,12 @@ class Libgit2 { late final _git_config_delete_multivarPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_config_delete_multivar'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_config_delete_multivar'); late final _git_config_delete_multivar = _git_config_delete_multivarPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Perform an operation on each config variable. /// @@ -16365,7 +16370,7 @@ class Libgit2 { late final _git_config_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_config_foreach_cb, + ffi.Int32 Function(ffi.Pointer, git_config_foreach_cb, ffi.Pointer)>>('git_config_foreach'); late final _git_config_foreach = _git_config_foreachPtr.asFunction< int Function(ffi.Pointer, git_config_foreach_cb, @@ -16391,7 +16396,7 @@ class Libgit2 { late final _git_config_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_config_iterator_new'); late final _git_config_iterator_new = _git_config_iterator_newPtr.asFunction< int Function(ffi.Pointer>, @@ -16413,7 +16418,7 @@ class Libgit2 { int git_config_iterator_glob_new( ffi.Pointer> out, ffi.Pointer cfg, - ffi.Pointer regexp, + ffi.Pointer regexp, ) { return _git_config_iterator_glob_new( out, @@ -16424,14 +16429,14 @@ class Libgit2 { late final _git_config_iterator_glob_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_config_iterator_glob_new'); + ffi.Pointer)>>('git_config_iterator_glob_new'); late final _git_config_iterator_glob_new = _git_config_iterator_glob_newPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Perform an operation on each config variable matching a regular expression. /// @@ -16453,7 +16458,7 @@ class Libgit2 { /// @return 0 or the return value of the callback which didn't return 0 int git_config_foreach_match( ffi.Pointer cfg, - ffi.Pointer regexp, + ffi.Pointer regexp, git_config_foreach_cb callback, ffi.Pointer payload, ) { @@ -16467,14 +16472,14 @@ class Libgit2 { late final _git_config_foreach_matchPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, git_config_foreach_cb, ffi.Pointer)>>('git_config_foreach_match'); late final _git_config_foreach_match = _git_config_foreach_matchPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, git_config_foreach_cb, ffi.Pointer)>(); /// Query the value of a config variable and return it mapped to @@ -16510,9 +16515,9 @@ class Libgit2 { /// @param map_n number of mapping objects in `maps` /// @return 0 on success, error code otherwise int git_config_get_mapped( - ffi.Pointer out, + ffi.Pointer out, ffi.Pointer cfg, - ffi.Pointer name, + ffi.Pointer name, ffi.Pointer maps, int map_n, ) { @@ -16527,15 +16532,15 @@ class Libgit2 { late final _git_config_get_mappedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_config_get_mapped'); + size_t)>>('git_config_get_mapped'); late final _git_config_get_mapped = _git_config_get_mappedPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, int)>(); /// Maps a string value to an integer constant /// @@ -16545,10 +16550,10 @@ class Libgit2 { /// @param value value to parse /// @return 0 or an error code. int git_config_lookup_map_value( - ffi.Pointer out, + ffi.Pointer out, ffi.Pointer maps, int map_n, - ffi.Pointer value, + ffi.Pointer value, ) { return _git_config_lookup_map_value( out, @@ -16560,12 +16565,12 @@ class Libgit2 { late final _git_config_lookup_map_valuePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Pointer)>>('git_config_lookup_map_value'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t, ffi.Pointer)>>('git_config_lookup_map_value'); late final _git_config_lookup_map_value = _git_config_lookup_map_valuePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); /// Parse a string value as a bool. /// @@ -16577,8 +16582,8 @@ class Libgit2 { /// @param value value to parse /// @return 0 or an error code. int git_config_parse_bool( - ffi.Pointer out, - ffi.Pointer value, + ffi.Pointer out, + ffi.Pointer value, ) { return _git_config_parse_bool( out, @@ -16588,10 +16593,10 @@ class Libgit2 { late final _git_config_parse_boolPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_config_parse_bool'); - late final _git_config_parse_bool = _git_config_parse_boolPtr - .asFunction, ffi.Pointer)>(); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_config_parse_bool'); + late final _git_config_parse_bool = _git_config_parse_boolPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// Parse a string value as an int32. /// @@ -16604,7 +16609,7 @@ class Libgit2 { /// @return 0 or an error code. int git_config_parse_int32( ffi.Pointer out, - ffi.Pointer value, + ffi.Pointer value, ) { return _git_config_parse_int32( out, @@ -16614,10 +16619,10 @@ class Libgit2 { late final _git_config_parse_int32Ptr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_config_parse_int32'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_config_parse_int32'); late final _git_config_parse_int32 = _git_config_parse_int32Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Parse a string value as an int64. /// @@ -16630,7 +16635,7 @@ class Libgit2 { /// @return 0 or an error code. int git_config_parse_int64( ffi.Pointer out, - ffi.Pointer value, + ffi.Pointer value, ) { return _git_config_parse_int64( out, @@ -16640,10 +16645,10 @@ class Libgit2 { late final _git_config_parse_int64Ptr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_config_parse_int64'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_config_parse_int64'); late final _git_config_parse_int64 = _git_config_parse_int64Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Parse a string value as a path. /// @@ -16659,7 +16664,7 @@ class Libgit2 { /// @return 0 or an error code. int git_config_parse_path( ffi.Pointer out, - ffi.Pointer value, + ffi.Pointer value, ) { return _git_config_parse_path( out, @@ -16669,10 +16674,10 @@ class Libgit2 { late final _git_config_parse_pathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_config_parse_path'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_config_parse_path'); late final _git_config_parse_path = _git_config_parse_pathPtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Perform an operation on each config variable in a given config backend, /// matching a regular expression. @@ -16691,7 +16696,7 @@ class Libgit2 { /// @return 0 or an error code. int git_config_backend_foreach_match( ffi.Pointer backend, - ffi.Pointer regexp, + ffi.Pointer regexp, git_config_foreach_cb callback, ffi.Pointer payload, ) { @@ -16705,14 +16710,14 @@ class Libgit2 { late final _git_config_backend_foreach_matchPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, git_config_foreach_cb, ffi.Pointer)>>('git_config_backend_foreach_match'); late final _git_config_backend_foreach_match = _git_config_backend_foreach_matchPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, git_config_foreach_cb, ffi.Pointer)>(); /// Lock the backend with the highest priority @@ -16741,7 +16746,7 @@ class Libgit2 { late final _git_config_lockPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_config_lock'); late final _git_config_lock = _git_config_lockPtr.asFunction< int Function(ffi.Pointer>, @@ -16767,8 +16772,8 @@ class Libgit2 { late final _git_describe_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_describe_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_describe_options_init'); late final _git_describe_options_init = _git_describe_options_initPtr .asFunction, int)>(); @@ -16792,8 +16797,8 @@ class Libgit2 { late final _git_describe_format_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_describe_format_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_describe_format_options_init'); late final _git_describe_format_options_init = _git_describe_format_options_initPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -16821,7 +16826,7 @@ class Libgit2 { late final _git_describe_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_describe_commit'); @@ -16854,7 +16859,7 @@ class Libgit2 { late final _git_describe_workdirPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_describe_workdir'); @@ -16883,7 +16888,7 @@ class Libgit2 { late final _git_describe_formatPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( @@ -16939,8 +16944,7 @@ class Libgit2 { late final _git_error_clear = _git_error_clearPtr.asFunction(); - /// Set the error message string for this thread, using `printf`-style - /// formatting. + /// Set the error message string for this thread. /// /// This function is public so that custom ODB backends and the like can /// relay an error message through libgit2. Most regular users of libgit2 @@ -16953,35 +16957,11 @@ class Libgit2 { /// /// @param error_class One of the `git_error_t` enum above describing the /// general subsystem that is responsible for the error. - /// @param fmt The `printf`-style format string; subsequent arguments must - /// be the arguments for the format string. - void git_error_set( - int error_class, - ffi.Pointer fmt, - ) { - return _git_error_set( - error_class, - fmt, - ); - } - - late final _git_error_setPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>>('git_error_set'); - late final _git_error_set = - _git_error_setPtr.asFunction)>(); - - /// Set the error message string for this thread. This function is like - /// `git_error_set` but takes a static string instead of a `printf`-style - /// format. - /// - /// @param error_class One of the `git_error_t` enum above describing the - /// general subsystem that is responsible for the error. - /// @param string The error message to keep + /// @param string The formatted error message to keep /// @return 0 on success or -1 on failure int git_error_set_str( int error_class, - ffi.Pointer string, + ffi.Pointer string, ) { return _git_error_set_str( error_class, @@ -16990,10 +16970,11 @@ class Libgit2 { } late final _git_error_set_strPtr = _lookup< - ffi.NativeFunction)>>( - 'git_error_set_str'); + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Int32, ffi.Pointer)>>('git_error_set_str'); late final _git_error_set_str = _git_error_set_strPtr - .asFunction)>(); + .asFunction)>(); /// Set the error message to a special value for memory allocation failure. /// @@ -17028,7 +17009,7 @@ class Libgit2 { ffi.Pointer> filters, ffi.Pointer repo, ffi.Pointer blob, - ffi.Pointer path, + ffi.Pointer path, int mode, int flags, ) { @@ -17044,11 +17025,11 @@ class Libgit2 { late final _git_filter_list_loadPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Int32, ffi.Uint32)>>('git_filter_list_load'); late final _git_filter_list_load = _git_filter_list_loadPtr.asFunction< @@ -17056,7 +17037,7 @@ class Libgit2 { ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, int)>(); @@ -17077,7 +17058,7 @@ class Libgit2 { ffi.Pointer> filters, ffi.Pointer repo, ffi.Pointer blob, - ffi.Pointer path, + ffi.Pointer path, int mode, ffi.Pointer opts, ) { @@ -17093,11 +17074,11 @@ class Libgit2 { late final _git_filter_list_load_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Int32, ffi.Pointer)>>('git_filter_list_load_ext'); late final _git_filter_list_load_ext = @@ -17106,7 +17087,7 @@ class Libgit2 { ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); @@ -17122,7 +17103,7 @@ class Libgit2 { /// @return 1 if the filter is in the list, 0 otherwise int git_filter_list_contains( ffi.Pointer filters, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_filter_list_contains( filters, @@ -17132,11 +17113,11 @@ class Libgit2 { late final _git_filter_list_containsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_filter_list_contains'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_filter_list_contains'); late final _git_filter_list_contains = _git_filter_list_containsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Apply filter list to a data buffer. /// @@ -17148,7 +17129,7 @@ class Libgit2 { int git_filter_list_apply_to_buffer( ffi.Pointer out, ffi.Pointer filters, - ffi.Pointer in1, + ffi.Pointer in1, int in_len, ) { return _git_filter_list_apply_to_buffer( @@ -17161,15 +17142,15 @@ class Libgit2 { late final _git_filter_list_apply_to_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Size)>>('git_filter_list_apply_to_buffer'); + ffi.Pointer, + size_t)>>('git_filter_list_apply_to_buffer'); late final _git_filter_list_apply_to_buffer = _git_filter_list_apply_to_bufferPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer, int)>(); /// Apply a filter list to the contents of a file on disk /// @@ -17183,7 +17164,7 @@ class Libgit2 { ffi.Pointer out, ffi.Pointer filters, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_filter_list_apply_to_file( out, @@ -17195,15 +17176,15 @@ class Libgit2 { late final _git_filter_list_apply_to_filePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_filter_list_apply_to_file'); + ffi.Pointer)>>('git_filter_list_apply_to_file'); late final _git_filter_list_apply_to_file = _git_filter_list_apply_to_filePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Apply a filter list to the contents of a blob /// @@ -17225,7 +17206,7 @@ class Libgit2 { late final _git_filter_list_apply_to_blobPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_filter_list_apply_to_blob'); late final _git_filter_list_apply_to_blob = _git_filter_list_apply_to_blobPtr.asFunction< @@ -17241,7 +17222,7 @@ class Libgit2 { /// @return 0 or an error code. int git_filter_list_stream_buffer( ffi.Pointer filters, - ffi.Pointer buffer, + ffi.Pointer buffer, int len, ffi.Pointer target, ) { @@ -17255,14 +17236,14 @@ class Libgit2 { late final _git_filter_list_stream_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, - ffi.Size, + ffi.Pointer, + size_t, ffi.Pointer)>>('git_filter_list_stream_buffer'); late final _git_filter_list_stream_buffer = _git_filter_list_stream_bufferPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, + int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); /// Apply a filter list to a file as a stream @@ -17276,7 +17257,7 @@ class Libgit2 { int git_filter_list_stream_file( ffi.Pointer filters, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ffi.Pointer target, ) { return _git_filter_list_stream_file( @@ -17289,17 +17270,17 @@ class Libgit2 { late final _git_filter_list_stream_filePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_filter_list_stream_file'); late final _git_filter_list_stream_file = _git_filter_list_stream_filePtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Apply a filter list to a blob as a stream @@ -17322,7 +17303,9 @@ class Libgit2 { late final _git_filter_list_stream_blobPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_filter_list_stream_blob'); late final _git_filter_list_stream_blob = _git_filter_list_stream_blobPtr.asFunction< @@ -17366,8 +17349,8 @@ class Libgit2 { late final _git_rebase_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_rebase_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_rebase_options_init'); late final _git_rebase_options_init = _git_rebase_options_initPtr .asFunction, int)>(); @@ -17406,7 +17389,7 @@ class Libgit2 { late final _git_rebase_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -17443,7 +17426,7 @@ class Libgit2 { late final _git_rebase_openPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_rebase_open'); @@ -17455,7 +17438,7 @@ class Libgit2 { /// /// @param rebase The in-progress rebase. /// @return The original `HEAD` ref name - ffi.Pointer git_rebase_orig_head_name( + ffi.Pointer git_rebase_orig_head_name( ffi.Pointer rebase, ) { return _git_rebase_orig_head_name( @@ -17465,10 +17448,10 @@ class Libgit2 { late final _git_rebase_orig_head_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_rebase_orig_head_name'); late final _git_rebase_orig_head_name = _git_rebase_orig_head_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Gets the original `HEAD` id for merge rebases. /// @@ -17493,7 +17476,7 @@ class Libgit2 { /// /// @param rebase The in-progress rebase. /// @return The `onto` ref name - ffi.Pointer git_rebase_onto_name( + ffi.Pointer git_rebase_onto_name( ffi.Pointer rebase, ) { return _git_rebase_onto_name( @@ -17503,10 +17486,10 @@ class Libgit2 { late final _git_rebase_onto_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_rebase_onto_name'); late final _git_rebase_onto_name = _git_rebase_onto_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Gets the `onto` id for merge rebases. /// @@ -17540,7 +17523,7 @@ class Libgit2 { } late final _git_rebase_operation_entrycountPtr = - _lookup)>>( + _lookup)>>( 'git_rebase_operation_entrycount'); late final _git_rebase_operation_entrycount = _git_rebase_operation_entrycountPtr @@ -17562,7 +17545,7 @@ class Libgit2 { } late final _git_rebase_operation_currentPtr = - _lookup)>>( + _lookup)>>( 'git_rebase_operation_current'); late final _git_rebase_operation_current = _git_rebase_operation_currentPtr .asFunction)>(); @@ -17585,7 +17568,7 @@ class Libgit2 { late final _git_rebase_operation_byindexPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Size)>>('git_rebase_operation_byindex'); + size_t)>>('git_rebase_operation_byindex'); late final _git_rebase_operation_byindex = _git_rebase_operation_byindexPtr.asFunction< ffi.Pointer Function( @@ -17612,7 +17595,7 @@ class Libgit2 { late final _git_rebase_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_rebase_next'); late final _git_rebase_next = _git_rebase_nextPtr.asFunction< int Function(ffi.Pointer>, @@ -17643,7 +17626,7 @@ class Libgit2 { late final _git_rebase_inmemory_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_rebase_inmemory_index'); late final _git_rebase_inmemory_index = _git_rebase_inmemory_indexPtr.asFunction< @@ -17675,8 +17658,8 @@ class Libgit2 { ffi.Pointer rebase, ffi.Pointer author, ffi.Pointer committer, - ffi.Pointer message_encoding, - ffi.Pointer message, + ffi.Pointer message_encoding, + ffi.Pointer message, ) { return _git_rebase_commit( id, @@ -17690,21 +17673,21 @@ class Libgit2 { late final _git_rebase_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_rebase_commit'); + ffi.Pointer, + ffi.Pointer)>>('git_rebase_commit'); late final _git_rebase_commit = _git_rebase_commitPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Aborts a rebase that is currently in progress, resetting the repository /// and working directory to their state before rebase began. @@ -17721,7 +17704,7 @@ class Libgit2 { } late final _git_rebase_abortPtr = - _lookup)>>( + _lookup)>>( 'git_rebase_abort'); late final _git_rebase_abort = _git_rebase_abortPtr.asFunction)>(); @@ -17744,7 +17727,7 @@ class Libgit2 { late final _git_rebase_finishPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_rebase_finish'); late final _git_rebase_finish = _git_rebase_finishPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -17784,7 +17767,7 @@ class Libgit2 { } late final _git_trace_setPtr = - _lookup>( + _lookup>( 'git_trace_set'); late final _git_trace_set = _git_trace_setPtr.asFunction(); @@ -17809,8 +17792,8 @@ class Libgit2 { late final _git_revert_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_revert_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_revert_options_init'); late final _git_revert_options_init = _git_revert_options_initPtr .asFunction, int)>(); @@ -17846,12 +17829,12 @@ class Libgit2 { late final _git_revert_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt, + ffi.Uint32, ffi.Pointer)>>('git_revert_commit'); late final _git_revert_commit = _git_revert_commitPtr.asFunction< int Function( @@ -17882,7 +17865,9 @@ class Libgit2 { late final _git_revertPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_revert'); late final _git_revert = _git_revertPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -17904,7 +17889,7 @@ class Libgit2 { int git_revparse_single( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer spec, + ffi.Pointer spec, ) { return _git_revparse_single( out, @@ -17915,13 +17900,13 @@ class Libgit2 { late final _git_revparse_singlePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_revparse_single'); + ffi.Pointer)>>('git_revparse_single'); late final _git_revparse_single = _git_revparse_singlePtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Find a single object and intermediate reference by a revision string. /// @@ -17946,7 +17931,7 @@ class Libgit2 { ffi.Pointer> object_out, ffi.Pointer> reference_out, ffi.Pointer repo, - ffi.Pointer spec, + ffi.Pointer spec, ) { return _git_revparse_ext( object_out, @@ -17958,17 +17943,17 @@ class Libgit2 { late final _git_revparse_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_revparse_ext'); + ffi.Pointer)>>('git_revparse_ext'); late final _git_revparse_ext = _git_revparse_extPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Parse a revision string for `from`, `to`, and intent. /// @@ -17984,7 +17969,7 @@ class Libgit2 { int git_revparse( ffi.Pointer revspec, ffi.Pointer repo, - ffi.Pointer spec, + ffi.Pointer spec, ) { return _git_revparse( revspec, @@ -17995,13 +17980,13 @@ class Libgit2 { late final _git_revparsePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_revparse'); + ffi.Pointer)>>('git_revparse'); late final _git_revparse = _git_revparsePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Save the local modifications to a new stash. /// @@ -18022,7 +18007,7 @@ class Libgit2 { ffi.Pointer out, ffi.Pointer repo, ffi.Pointer stasher, - ffi.Pointer message, + ffi.Pointer message, int flags, ) { return _git_stash_save( @@ -18036,15 +18021,15 @@ class Libgit2 { late final _git_stash_savePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Uint32)>>('git_stash_save'); late final _git_stash_save = _git_stash_savePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Initialize git_stash_apply_options structure /// @@ -18066,8 +18051,8 @@ class Libgit2 { late final _git_stash_apply_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_stash_apply_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_stash_apply_options_init'); late final _git_stash_apply_options_init = _git_stash_apply_options_initPtr .asFunction, int)>(); @@ -18109,7 +18094,7 @@ class Libgit2 { late final _git_stash_applyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, + ffi.Int32 Function(ffi.Pointer, size_t, ffi.Pointer)>>('git_stash_apply'); late final _git_stash_apply = _git_stash_applyPtr.asFunction< int Function(ffi.Pointer, int, @@ -18141,7 +18126,7 @@ class Libgit2 { late final _git_stash_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_stash_cb, + ffi.Int32 Function(ffi.Pointer, git_stash_cb, ffi.Pointer)>>('git_stash_foreach'); late final _git_stash_foreach = _git_stash_foreachPtr.asFunction< int Function( @@ -18168,8 +18153,8 @@ class Libgit2 { late final _git_stash_dropPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Size)>>('git_stash_drop'); + ffi.Int32 Function( + ffi.Pointer, size_t)>>('git_stash_drop'); late final _git_stash_drop = _git_stash_dropPtr .asFunction, int)>(); @@ -18197,7 +18182,7 @@ class Libgit2 { late final _git_stash_popPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, + ffi.Int32 Function(ffi.Pointer, size_t, ffi.Pointer)>>('git_stash_pop'); late final _git_stash_pop = _git_stash_popPtr.asFunction< int Function(ffi.Pointer, int, @@ -18223,8 +18208,8 @@ class Libgit2 { late final _git_status_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_status_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_status_options_init'); late final _git_status_options_init = _git_status_options_initPtr .asFunction, int)>(); @@ -18255,7 +18240,7 @@ class Libgit2 { late final _git_status_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_status_cb, + ffi.Int32 Function(ffi.Pointer, git_status_cb, ffi.Pointer)>>('git_status_foreach'); late final _git_status_foreach = _git_status_foreachPtr.asFunction< int Function( @@ -18294,7 +18279,7 @@ class Libgit2 { late final _git_status_foreach_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, git_status_cb, @@ -18328,9 +18313,9 @@ class Libgit2 { /// index, and work tree, GIT_EAMBIGUOUS if `path` matches multiple files /// or if it refers to a folder, and -1 on other errors. int git_status_file( - ffi.Pointer status_flags, + ffi.Pointer status_flags, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_status_file( status_flags, @@ -18341,13 +18326,13 @@ class Libgit2 { late final _git_status_filePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_status_file'); + ffi.Pointer)>>('git_status_file'); late final _git_status_file = _git_status_filePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Gather file status information and populate the `git_status_list`. /// @@ -18374,7 +18359,7 @@ class Libgit2 { late final _git_status_list_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_status_list_new'); @@ -18398,7 +18383,7 @@ class Libgit2 { } late final _git_status_list_entrycountPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_status_list_entrycount'); late final _git_status_list_entrycount = _git_status_list_entrycountPtr .asFunction)>(); @@ -18423,7 +18408,7 @@ class Libgit2 { late final _git_status_byindexPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('git_status_byindex'); + ffi.Pointer, size_t)>>('git_status_byindex'); late final _git_status_byindex = _git_status_byindexPtr.asFunction< ffi.Pointer Function( ffi.Pointer, int)>(); @@ -18460,9 +18445,9 @@ class Libgit2 { /// @return 0 if ignore rules could be processed for the file (regardless /// of whether it exists or not), or an error < 0 if they could not. int git_status_should_ignore( - ffi.Pointer ignored, + ffi.Pointer ignored, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_status_should_ignore( ignored, @@ -18473,12 +18458,14 @@ class Libgit2 { late final _git_status_should_ignorePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_status_should_ignore'); + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_status_should_ignore'); late final _git_status_should_ignore = _git_status_should_ignorePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Initialize git_submodule_update_options structure /// @@ -18500,8 +18487,8 @@ class Libgit2 { late final _git_submodule_update_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_submodule_update_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_submodule_update_options_init'); late final _git_submodule_update_options_init = _git_submodule_update_options_initPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -18536,7 +18523,7 @@ class Libgit2 { late final _git_submodule_updatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Int32 Function(ffi.Pointer, ffi.Int32, ffi.Pointer)>>( 'git_submodule_update'); late final _git_submodule_update = _git_submodule_updatePtr.asFunction< @@ -18571,7 +18558,7 @@ class Libgit2 { int git_submodule_lookup( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_submodule_lookup( out, @@ -18582,13 +18569,13 @@ class Libgit2 { late final _git_submodule_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_submodule_lookup'); + ffi.Pointer)>>('git_submodule_lookup'); late final _git_submodule_lookup = _git_submodule_lookupPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Create an in-memory copy of a submodule. The copy must be explicitly /// free'd or it will leak. @@ -18608,7 +18595,7 @@ class Libgit2 { late final _git_submodule_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_submodule_dup'); late final _git_submodule_dup = _git_submodule_dupPtr.asFunction< int Function(ffi.Pointer>, @@ -18661,7 +18648,7 @@ class Libgit2 { late final _git_submodule_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_submodule_cb, + ffi.Int32 Function(ffi.Pointer, git_submodule_cb, ffi.Pointer)>>('git_submodule_foreach'); late final _git_submodule_foreach = _git_submodule_foreachPtr.asFunction< int Function(ffi.Pointer, git_submodule_cb, @@ -18694,8 +18681,8 @@ class Libgit2 { int git_submodule_add_setup( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer url, - ffi.Pointer path, + ffi.Pointer url, + ffi.Pointer path, int use_gitlink, ) { return _git_submodule_add_setup( @@ -18709,18 +18696,18 @@ class Libgit2 { late final _git_submodule_add_setupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('git_submodule_add_setup'); + ffi.Pointer, + ffi.Pointer, + ffi.Int32)>>('git_submodule_add_setup'); late final _git_submodule_add_setup = _git_submodule_add_setupPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int)>(); /// Perform the clone step for a newly created submodule. @@ -18746,7 +18733,7 @@ class Libgit2 { late final _git_submodule_clonePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>( @@ -18774,9 +18761,9 @@ class Libgit2 { ); } - late final _git_submodule_add_finalizePtr = - _lookup)>>( - 'git_submodule_add_finalize'); + late final _git_submodule_add_finalizePtr = _lookup< + ffi.NativeFunction)>>( + 'git_submodule_add_finalize'); late final _git_submodule_add_finalize = _git_submodule_add_finalizePtr .asFunction)>(); @@ -18800,8 +18787,8 @@ class Libgit2 { late final _git_submodule_add_to_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Int)>>('git_submodule_add_to_index'); + ffi.Int32 Function(ffi.Pointer, + ffi.Int32)>>('git_submodule_add_to_index'); late final _git_submodule_add_to_index = _git_submodule_add_to_indexPtr .asFunction, int)>(); @@ -18833,7 +18820,7 @@ class Libgit2 { /// /// @param submodule Pointer to submodule object /// @return Pointer to the submodule name - ffi.Pointer git_submodule_name( + ffi.Pointer git_submodule_name( ffi.Pointer submodule, ) { return _git_submodule_name( @@ -18843,10 +18830,10 @@ class Libgit2 { late final _git_submodule_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_submodule_name'); late final _git_submodule_name = _git_submodule_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the path to the submodule. /// @@ -18855,7 +18842,7 @@ class Libgit2 { /// /// @param submodule Pointer to submodule object /// @return Pointer to the submodule path - ffi.Pointer git_submodule_path( + ffi.Pointer git_submodule_path( ffi.Pointer submodule, ) { return _git_submodule_path( @@ -18865,16 +18852,16 @@ class Libgit2 { late final _git_submodule_pathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_submodule_path'); late final _git_submodule_path = _git_submodule_pathPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the URL for the submodule. /// /// @param submodule Pointer to submodule object /// @return Pointer to the submodule url - ffi.Pointer git_submodule_url( + ffi.Pointer git_submodule_url( ffi.Pointer submodule, ) { return _git_submodule_url( @@ -18884,10 +18871,10 @@ class Libgit2 { late final _git_submodule_urlPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_submodule_url'); late final _git_submodule_url = _git_submodule_urlPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Resolve a submodule url relative to the given repository. /// @@ -18898,7 +18885,7 @@ class Libgit2 { int git_submodule_resolve_url( ffi.Pointer out, ffi.Pointer repo, - ffi.Pointer url, + ffi.Pointer url, ) { return _git_submodule_resolve_url( out, @@ -18909,18 +18896,18 @@ class Libgit2 { late final _git_submodule_resolve_urlPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_submodule_resolve_url'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_submodule_resolve_url'); late final _git_submodule_resolve_url = _git_submodule_resolve_urlPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Get the branch for the submodule. /// /// @param submodule Pointer to submodule object /// @return Pointer to the submodule branch - ffi.Pointer git_submodule_branch( + ffi.Pointer git_submodule_branch( ffi.Pointer submodule, ) { return _git_submodule_branch( @@ -18930,10 +18917,10 @@ class Libgit2 { late final _git_submodule_branchPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_submodule_branch'); late final _git_submodule_branch = _git_submodule_branchPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Set the branch for the submodule in the configuration /// @@ -18946,8 +18933,8 @@ class Libgit2 { /// @return 0 on success, <0 on failure int git_submodule_set_branch( ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer branch, + ffi.Pointer name, + ffi.Pointer branch, ) { return _git_submodule_set_branch( repo, @@ -18958,12 +18945,12 @@ class Libgit2 { late final _git_submodule_set_branchPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_submodule_set_branch'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_submodule_set_branch'); late final _git_submodule_set_branch = _git_submodule_set_branchPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Set the URL for the submodule in the configuration /// @@ -18977,8 +18964,8 @@ class Libgit2 { /// @return 0 on success, <0 on failure int git_submodule_set_url( ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer url, + ffi.Pointer name, + ffi.Pointer url, ) { return _git_submodule_set_url( repo, @@ -18989,11 +18976,11 @@ class Libgit2 { late final _git_submodule_set_urlPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_submodule_set_url'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_submodule_set_url'); late final _git_submodule_set_url = _git_submodule_set_urlPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Get the OID for the submodule in the index. /// @@ -19102,7 +19089,7 @@ class Libgit2 { /// @return 0 or an error code int git_submodule_set_ignore( ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, int ignore, ) { return _git_submodule_set_ignore( @@ -19114,12 +19101,12 @@ class Libgit2 { late final _git_submodule_set_ignorePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_submodule_set_ignore'); late final _git_submodule_set_ignore = _git_submodule_set_ignorePtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Get the update rule that will be used for the submodule. /// @@ -19153,7 +19140,7 @@ class Libgit2 { /// @return 0 or an error code int git_submodule_set_update( ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, int update, ) { return _git_submodule_set_update( @@ -19165,12 +19152,12 @@ class Libgit2 { late final _git_submodule_set_updatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_submodule_set_update'); late final _git_submodule_set_update = _git_submodule_set_updatePtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Read the fetchRecurseSubmodules rule for a submodule. /// @@ -19206,7 +19193,7 @@ class Libgit2 { /// @return old value for fetchRecurseSubmodules int git_submodule_set_fetch_recurse_submodules( ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, int fetch_recurse_submodules, ) { return _git_submodule_set_fetch_recurse_submodules( @@ -19218,12 +19205,12 @@ class Libgit2 { late final _git_submodule_set_fetch_recurse_submodulesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_submodule_set_fetch_recurse_submodules'); late final _git_submodule_set_fetch_recurse_submodules = _git_submodule_set_fetch_recurse_submodulesPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Copy submodule info into ".git/config" file. /// @@ -19248,8 +19235,8 @@ class Libgit2 { late final _git_submodule_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int)>>('git_submodule_init'); + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('git_submodule_init'); late final _git_submodule_init = _git_submodule_initPtr .asFunction, int)>(); @@ -19278,8 +19265,10 @@ class Libgit2 { late final _git_submodule_repo_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.Int)>>('git_submodule_repo_init'); + ffi.Int32 Function( + ffi.Pointer>, + ffi.Pointer, + ffi.Int32)>>('git_submodule_repo_init'); late final _git_submodule_repo_init = _git_submodule_repo_initPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, int)>(); @@ -19301,9 +19290,9 @@ class Libgit2 { ); } - late final _git_submodule_syncPtr = - _lookup)>>( - 'git_submodule_sync'); + late final _git_submodule_syncPtr = _lookup< + ffi.NativeFunction)>>( + 'git_submodule_sync'); late final _git_submodule_sync = _git_submodule_syncPtr .asFunction)>(); @@ -19329,7 +19318,7 @@ class Libgit2 { late final _git_submodule_openPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_submodule_open'); late final _git_submodule_open = _git_submodule_openPtr.asFunction< int Function(ffi.Pointer>, @@ -19355,8 +19344,8 @@ class Libgit2 { late final _git_submodule_reloadPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int)>>('git_submodule_reload'); + ffi.Int32 Function( + ffi.Pointer, ffi.Int32)>>('git_submodule_reload'); late final _git_submodule_reload = _git_submodule_reloadPtr .asFunction, int)>(); @@ -19373,9 +19362,9 @@ class Libgit2 { /// @param ignore the ignore rules to follow /// @return 0 on success, <0 on error int git_submodule_status( - ffi.Pointer status, + ffi.Pointer status, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, int ignore, ) { return _git_submodule_status( @@ -19388,14 +19377,14 @@ class Libgit2 { late final _git_submodule_statusPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('git_submodule_status'); late final _git_submodule_status = _git_submodule_statusPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int)>(); /// Get the locations of submodule information. /// @@ -19410,7 +19399,7 @@ class Libgit2 { /// @param submodule Submodule for which to get status /// @return 0 on success, <0 on error int git_submodule_location( - ffi.Pointer location_status, + ffi.Pointer location_status, ffi.Pointer submodule, ) { return _git_submodule_location( @@ -19421,10 +19410,10 @@ class Libgit2 { late final _git_submodule_locationPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_submodule_location'); late final _git_submodule_location = _git_submodule_locationPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// List names of linked working trees /// @@ -19446,7 +19435,7 @@ class Libgit2 { late final _git_worktree_listPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_worktree_list'); late final _git_worktree_list = _git_worktree_listPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -19460,7 +19449,7 @@ class Libgit2 { int git_worktree_lookup( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_worktree_lookup( out, @@ -19471,13 +19460,13 @@ class Libgit2 { late final _git_worktree_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_worktree_lookup'); + ffi.Pointer)>>('git_worktree_lookup'); late final _git_worktree_lookup = _git_worktree_lookupPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Open a worktree of a given repository /// @@ -19500,7 +19489,7 @@ class Libgit2 { late final _git_worktree_open_from_repositoryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>( 'git_worktree_open_from_repository'); late final _git_worktree_open_from_repository = @@ -19541,9 +19530,9 @@ class Libgit2 { ); } - late final _git_worktree_validatePtr = - _lookup)>>( - 'git_worktree_validate'); + late final _git_worktree_validatePtr = _lookup< + ffi.NativeFunction)>>( + 'git_worktree_validate'); late final _git_worktree_validate = _git_worktree_validatePtr .asFunction)>(); @@ -19567,8 +19556,8 @@ class Libgit2 { late final _git_worktree_add_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_worktree_add_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_worktree_add_options_init'); late final _git_worktree_add_options_init = _git_worktree_add_options_initPtr .asFunction, int)>(); @@ -19587,8 +19576,8 @@ class Libgit2 { int git_worktree_add( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, - ffi.Pointer path, + ffi.Pointer name, + ffi.Pointer path, ffi.Pointer opts, ) { return _git_worktree_add( @@ -19602,18 +19591,18 @@ class Libgit2 { late final _git_worktree_addPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_worktree_add'); late final _git_worktree_add = _git_worktree_addPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Lock worktree if not already locked @@ -19626,7 +19615,7 @@ class Libgit2 { /// @return 0 on success, non-zero otherwise int git_worktree_lock( ffi.Pointer wt, - ffi.Pointer reason, + ffi.Pointer reason, ) { return _git_worktree_lock( wt, @@ -19636,10 +19625,10 @@ class Libgit2 { late final _git_worktree_lockPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_worktree_lock'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_worktree_lock'); late final _git_worktree_lock = _git_worktree_lockPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Unlock a locked worktree /// @@ -19654,9 +19643,9 @@ class Libgit2 { ); } - late final _git_worktree_unlockPtr = - _lookup)>>( - 'git_worktree_unlock'); + late final _git_worktree_unlockPtr = _lookup< + ffi.NativeFunction)>>( + 'git_worktree_unlock'); late final _git_worktree_unlock = _git_worktree_unlockPtr .asFunction)>(); @@ -19682,7 +19671,7 @@ class Libgit2 { late final _git_worktree_is_lockedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_worktree_is_locked'); late final _git_worktree_is_locked = _git_worktree_is_lockedPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -19692,7 +19681,7 @@ class Libgit2 { /// @param wt Worktree to get the name for /// @return The worktree's name. The pointer returned is valid for the /// lifetime of the git_worktree - ffi.Pointer git_worktree_name( + ffi.Pointer git_worktree_name( ffi.Pointer wt, ) { return _git_worktree_name( @@ -19702,17 +19691,17 @@ class Libgit2 { late final _git_worktree_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_worktree_name'); late final _git_worktree_name = _git_worktree_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Retrieve the filesystem path for the worktree /// /// @param wt Worktree to get the path for /// @return The worktree's filesystem path. The pointer returned /// is valid for the lifetime of the git_worktree. - ffi.Pointer git_worktree_path( + ffi.Pointer git_worktree_path( ffi.Pointer wt, ) { return _git_worktree_path( @@ -19722,10 +19711,10 @@ class Libgit2 { late final _git_worktree_pathPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_worktree_path'); late final _git_worktree_path = _git_worktree_pathPtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Initialize git_worktree_prune_options structure /// @@ -19747,8 +19736,8 @@ class Libgit2 { late final _git_worktree_prune_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_worktree_prune_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_worktree_prune_options_init'); late final _git_worktree_prune_options_init = _git_worktree_prune_options_initPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -19781,7 +19770,7 @@ class Libgit2 { late final _git_worktree_is_prunablePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>( 'git_worktree_is_prunable'); late final _git_worktree_is_prunable = @@ -19811,7 +19800,7 @@ class Libgit2 { late final _git_worktree_prunePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_worktree_prune'); late final _git_worktree_prune = _git_worktree_prunePtr.asFunction< int Function(ffi.Pointer, @@ -19831,8 +19820,8 @@ class Libgit2 { /// @return 0 or an error code. int git_credential_userpass( ffi.Pointer> out, - ffi.Pointer url, - ffi.Pointer user_from_url, + ffi.Pointer url, + ffi.Pointer user_from_url, int allowed_types, ffi.Pointer payload, ) { @@ -19847,24 +19836,24 @@ class Libgit2 { late final _git_credential_userpassPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, ffi.Pointer)>>('git_credential_userpass'); late final _git_credential_userpass = _git_credential_userpassPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); int git_blob_create_fromworkdir( ffi.Pointer id, ffi.Pointer repo, - ffi.Pointer relative_path, + ffi.Pointer relative_path, ) { return _git_blob_create_fromworkdir( id, @@ -19875,17 +19864,17 @@ class Libgit2 { late final _git_blob_create_fromworkdirPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_blob_create_fromworkdir'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_blob_create_fromworkdir'); late final _git_blob_create_fromworkdir = _git_blob_create_fromworkdirPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); int git_blob_create_fromdisk( ffi.Pointer id, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_blob_create_fromdisk( id, @@ -19896,17 +19885,17 @@ class Libgit2 { late final _git_blob_create_fromdiskPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_blob_create_fromdisk'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_blob_create_fromdisk'); late final _git_blob_create_fromdisk = _git_blob_create_fromdiskPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); int git_blob_create_fromstream( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer hintpath, + ffi.Pointer hintpath, ) { return _git_blob_create_fromstream( out, @@ -19917,14 +19906,14 @@ class Libgit2 { late final _git_blob_create_fromstreamPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_blob_create_fromstream'); + ffi.Pointer)>>('git_blob_create_fromstream'); late final _git_blob_create_fromstream = _git_blob_create_fromstreamPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); int git_blob_create_fromstream_commit( ffi.Pointer out, @@ -19938,7 +19927,7 @@ class Libgit2 { late final _git_blob_create_fromstream_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>( 'git_blob_create_fromstream_commit'); late final _git_blob_create_fromstream_commit = @@ -19961,8 +19950,8 @@ class Libgit2 { late final _git_blob_create_frombufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('git_blob_create_frombuffer'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, size_t)>>('git_blob_create_frombuffer'); late final _git_blob_create_frombuffer = _git_blob_create_frombufferPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -19975,7 +19964,7 @@ class Libgit2 { int git_blob_filtered_content( ffi.Pointer out, ffi.Pointer blob, - ffi.Pointer as_path, + ffi.Pointer as_path, int check_for_binary_data, ) { return _git_blob_filtered_content( @@ -19988,12 +19977,12 @@ class Libgit2 { late final _git_blob_filtered_contentPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int)>>('git_blob_filtered_content'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('git_blob_filtered_content'); late final _git_blob_filtered_content = _git_blob_filtered_contentPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer, int)>(); /// Deprecated in favor of `git_filter_list_stream_buffer`. /// @@ -20013,7 +20002,7 @@ class Libgit2 { late final _git_filter_list_stream_dataPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_filter_list_stream_data'); late final _git_filter_list_stream_data = _git_filter_list_stream_dataPtr.asFunction< @@ -20038,7 +20027,7 @@ class Libgit2 { late final _git_filter_list_apply_to_dataPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_filter_list_apply_to_data'); late final _git_filter_list_apply_to_data = _git_filter_list_apply_to_dataPtr.asFunction< @@ -20068,7 +20057,7 @@ class Libgit2 { late final _git_treebuilder_write_with_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_treebuilder_write_with_buffer'); late final _git_treebuilder_write_with_buffer = _git_treebuilder_write_with_bufferPtr.asFunction< @@ -20105,7 +20094,7 @@ class Libgit2 { } late final _git_buf_growPtr = _lookup< - ffi.NativeFunction, ffi.Size)>>( + ffi.NativeFunction, size_t)>>( 'git_buf_grow'); late final _git_buf_grow = _git_buf_growPtr.asFunction, int)>(); @@ -20130,8 +20119,8 @@ class Libgit2 { late final _git_buf_setPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_buf_set'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t)>>('git_buf_set'); late final _git_buf_set = _git_buf_setPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -20148,7 +20137,7 @@ class Libgit2 { } late final _git_buf_is_binaryPtr = - _lookup)>>( + _lookup)>>( 'git_buf_is_binary'); late final _git_buf_is_binary = _git_buf_is_binaryPtr.asFunction)>(); @@ -20166,7 +20155,7 @@ class Libgit2 { } late final _git_buf_contains_nulPtr = - _lookup)>>( + _lookup)>>( 'git_buf_contains_nul'); late final _git_buf_contains_nul = _git_buf_contains_nulPtr.asFunction)>(); @@ -20211,7 +20200,7 @@ class Libgit2 { late final _git_diff_format_emailPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( 'git_diff_format_email'); late final _git_diff_format_email = _git_diff_format_emailPtr.asFunction< @@ -20244,12 +20233,12 @@ class Libgit2 { late final _git_diff_commit_as_emailPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Size, - ffi.Size, + size_t, + size_t, ffi.Uint32, ffi.Pointer)>>('git_diff_commit_as_email'); late final _git_diff_commit_as_email = @@ -20283,8 +20272,8 @@ class Libgit2 { late final _git_diff_format_email_options_initPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_format_email_options_init'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_format_email_options_init'); late final _git_diff_format_email_options_init = _git_diff_format_email_options_initPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -20334,7 +20323,7 @@ class Libgit2 { /// @see git_error_set_str void giterr_set_str( int error_class, - ffi.Pointer string, + ffi.Pointer string, ) { return _giterr_set_str( error_class, @@ -20344,9 +20333,10 @@ class Libgit2 { late final _giterr_set_strPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>>('giterr_set_str'); + ffi.Void Function( + ffi.Int32, ffi.Pointer)>>('giterr_set_str'); late final _giterr_set_str = _giterr_set_strPtr - .asFunction)>(); + .asFunction)>(); /// Indicates that an out-of-memory situation occurred. This is an alias /// of `git_error_set_oom` and is preserved for backward compatibility. @@ -20380,8 +20370,11 @@ class Libgit2 { late final _git_index_add_frombufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('git_index_add_frombuffer'); + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + size_t)>>('git_index_add_frombuffer'); late final _git_index_add_frombuffer = _git_index_add_frombufferPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -20406,7 +20399,7 @@ class Libgit2 { } late final _git_object__sizePtr = - _lookup>( + _lookup>( 'git_object__size'); late final _git_object__size = _git_object__sizePtr.asFunction(); @@ -20417,7 +20410,7 @@ class Libgit2 { /// @param remote_name name to be checked. /// @return 1 if the reference name is acceptable; 0 if it isn't int git_remote_is_valid_name( - ffi.Pointer remote_name, + ffi.Pointer remote_name, ) { return _git_remote_is_valid_name( remote_name, @@ -20425,10 +20418,10 @@ class Libgit2 { } late final _git_remote_is_valid_namePtr = - _lookup)>>( + _lookup)>>( 'git_remote_is_valid_name'); late final _git_remote_is_valid_name = _git_remote_is_valid_namePtr - .asFunction)>(); + .asFunction)>(); /// Ensure the reference name is well-formed. /// @@ -20444,7 +20437,7 @@ class Libgit2 { /// @param refname name to be checked. /// @return 1 if the reference name is acceptable; 0 if it isn't int git_reference_is_valid_name( - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_reference_is_valid_name( refname, @@ -20452,15 +20445,15 @@ class Libgit2 { } late final _git_reference_is_valid_namePtr = - _lookup)>>( + _lookup)>>( 'git_reference_is_valid_name'); late final _git_reference_is_valid_name = _git_reference_is_valid_namePtr - .asFunction)>(); + .asFunction)>(); int git_tag_create_frombuffer( ffi.Pointer oid, ffi.Pointer repo, - ffi.Pointer buffer, + ffi.Pointer buffer, int force, ) { return _git_tag_create_frombuffer( @@ -20473,12 +20466,12 @@ class Libgit2 { late final _git_tag_create_frombufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int)>>('git_tag_create_frombuffer'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('git_tag_create_frombuffer'); late final _git_tag_create_frombuffer = _git_tag_create_frombufferPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer, int)>(); void git_cred_free( ffi.Pointer cred, @@ -20503,12 +20496,12 @@ class Libgit2 { } late final _git_cred_has_usernamePtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_cred_has_username'); late final _git_cred_has_username = _git_cred_has_usernamePtr .asFunction)>(); - ffi.Pointer git_cred_get_username( + ffi.Pointer git_cred_get_username( ffi.Pointer cred, ) { return _git_cred_get_username( @@ -20518,15 +20511,15 @@ class Libgit2 { late final _git_cred_get_usernamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_cred_get_username'); late final _git_cred_get_username = _git_cred_get_usernamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); int git_cred_userpass_plaintext_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer password, + ffi.Pointer username, + ffi.Pointer password, ) { return _git_cred_userpass_plaintext_new( out, @@ -20537,14 +20530,14 @@ class Libgit2 { late final _git_cred_userpass_plaintext_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>>('git_cred_userpass_plaintext_new'); + ffi.Pointer, + ffi.Pointer)>>('git_cred_userpass_plaintext_new'); late final _git_cred_userpass_plaintext_new = _git_cred_userpass_plaintext_newPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); int git_cred_default_new( ffi.Pointer> out, @@ -20556,14 +20549,14 @@ class Libgit2 { late final _git_cred_default_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>)>>( + ffi.Int32 Function(ffi.Pointer>)>>( 'git_cred_default_new'); late final _git_cred_default_new = _git_cred_default_newPtr .asFunction>)>(); int git_cred_username_new( ffi.Pointer> out, - ffi.Pointer username, + ffi.Pointer username, ) { return _git_cred_username_new( out, @@ -20573,18 +20566,18 @@ class Libgit2 { late final _git_cred_username_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_cred_username_new'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_cred_username_new'); late final _git_cred_username_new = _git_cred_username_newPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer)>(); + ffi.Pointer>, ffi.Pointer)>(); int git_cred_ssh_key_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer publickey, - ffi.Pointer privatekey, - ffi.Pointer passphrase, + ffi.Pointer username, + ffi.Pointer publickey, + ffi.Pointer privatekey, + ffi.Pointer passphrase, ) { return _git_cred_ssh_key_new( out, @@ -20597,26 +20590,26 @@ class Libgit2 { late final _git_cred_ssh_key_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_cred_ssh_key_new'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_cred_ssh_key_new'); late final _git_cred_ssh_key_new = _git_cred_ssh_key_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); int git_cred_ssh_key_memory_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer publickey, - ffi.Pointer privatekey, - ffi.Pointer passphrase, + ffi.Pointer username, + ffi.Pointer publickey, + ffi.Pointer privatekey, + ffi.Pointer passphrase, ) { return _git_cred_ssh_key_memory_new( out, @@ -20629,24 +20622,24 @@ class Libgit2 { late final _git_cred_ssh_key_memory_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_cred_ssh_key_memory_new'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_cred_ssh_key_memory_new'); late final _git_cred_ssh_key_memory_new = _git_cred_ssh_key_memory_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); int git_cred_ssh_interactive_new( ffi.Pointer> out, - ffi.Pointer username, + ffi.Pointer username, git_credential_ssh_interactive_cb prompt_callback, ffi.Pointer payload, ) { @@ -20660,22 +20653,22 @@ class Libgit2 { late final _git_cred_ssh_interactive_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, git_credential_ssh_interactive_cb, ffi.Pointer)>>('git_cred_ssh_interactive_new'); late final _git_cred_ssh_interactive_new = _git_cred_ssh_interactive_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, git_credential_ssh_interactive_cb, ffi.Pointer)>(); int git_cred_ssh_key_from_agent( ffi.Pointer> out, - ffi.Pointer username, + ffi.Pointer username, ) { return _git_cred_ssh_key_from_agent( out, @@ -20685,17 +20678,17 @@ class Libgit2 { late final _git_cred_ssh_key_from_agentPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_cred_ssh_key_from_agent'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_cred_ssh_key_from_agent'); late final _git_cred_ssh_key_from_agent = _git_cred_ssh_key_from_agentPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); int git_cred_ssh_custom_new( ffi.Pointer> out, - ffi.Pointer username, - ffi.Pointer publickey, + ffi.Pointer username, + ffi.Pointer publickey, int publickey_len, git_credential_sign_cb sign_callback, ffi.Pointer payload, @@ -20712,26 +20705,26 @@ class Libgit2 { late final _git_cred_ssh_custom_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Size, + ffi.Pointer, + ffi.Pointer, + size_t, git_credential_sign_cb, ffi.Pointer)>>('git_cred_ssh_custom_new'); late final _git_cred_ssh_custom_new = _git_cred_ssh_custom_newPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, git_credential_sign_cb, ffi.Pointer)>(); int git_cred_userpass( ffi.Pointer> out, - ffi.Pointer url, - ffi.Pointer user_from_url, + ffi.Pointer url, + ffi.Pointer user_from_url, int allowed_types, ffi.Pointer payload, ) { @@ -20746,17 +20739,17 @@ class Libgit2 { late final _git_cred_userpassPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, ffi.Pointer)>>('git_cred_userpass'); late final _git_cred_userpass = _git_cred_userpassPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, int, ffi.Pointer)>(); @@ -20778,7 +20771,7 @@ class Libgit2 { } late final _git_oid_iszeroPtr = - _lookup)>>( + _lookup)>>( 'git_oid_iszero'); late final _git_oid_iszero = _git_oid_iszeroPtr.asFunction)>(); @@ -20805,31 +20798,6 @@ class Libgit2 { late final _git_oidarray_free = _git_oidarray_freePtr .asFunction)>(); - /// Copy a string array object from source to target. - /// - /// Note: target is overwritten and hence should be empty, otherwise its - /// contents are leaked. Call git_strarray_free() if necessary. - /// - /// @param tgt target - /// @param src source - /// @return 0 on success, < 0 on allocation failure - int git_strarray_copy1( - ffi.Pointer tgt, - ffi.Pointer src, - ) { - return _git_strarray_copy1( - tgt, - src, - ); - } - - late final _git_strarray_copy1Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_strarray_copy'); - late final _git_strarray_copy1 = _git_strarray_copy1Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - /// Free the memory referred to by the git_strarray. This is an alias of /// `git_strarray_dispose` and is preserved for backward compatibility. /// @@ -20873,8 +20841,8 @@ class Libgit2 { late final _git_blame_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_blame_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_blame_init_options'); late final _git_blame_init_options = _git_blame_init_optionsPtr .asFunction, int)>(); @@ -20890,8 +20858,8 @@ class Libgit2 { late final _git_checkout_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_checkout_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_checkout_init_options'); late final _git_checkout_init_options = _git_checkout_init_optionsPtr .asFunction, int)>(); @@ -20907,8 +20875,8 @@ class Libgit2 { late final _git_cherrypick_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_cherrypick_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_cherrypick_init_options'); late final _git_cherrypick_init_options = _git_cherrypick_init_optionsPtr .asFunction, int)>(); @@ -20924,8 +20892,8 @@ class Libgit2 { late final _git_clone_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_clone_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_clone_init_options'); late final _git_clone_init_options = _git_clone_init_optionsPtr .asFunction, int)>(); @@ -20941,8 +20909,8 @@ class Libgit2 { late final _git_describe_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_describe_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_describe_init_options'); late final _git_describe_init_options = _git_describe_init_optionsPtr .asFunction, int)>(); @@ -20958,8 +20926,8 @@ class Libgit2 { late final _git_describe_init_format_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_describe_init_format_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_describe_init_format_options'); late final _git_describe_init_format_options = _git_describe_init_format_optionsPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -20976,8 +20944,8 @@ class Libgit2 { late final _git_diff_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_init_options'); late final _git_diff_init_options = _git_diff_init_optionsPtr .asFunction, int)>(); @@ -20993,8 +20961,8 @@ class Libgit2 { late final _git_diff_find_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_find_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_find_init_options'); late final _git_diff_find_init_options = _git_diff_find_init_optionsPtr .asFunction, int)>(); @@ -21010,8 +20978,8 @@ class Libgit2 { late final _git_diff_format_email_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_format_email_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_format_email_init_options'); late final _git_diff_format_email_init_options = _git_diff_format_email_init_optionsPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -21028,8 +20996,8 @@ class Libgit2 { late final _git_diff_patchid_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_diff_patchid_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_diff_patchid_init_options'); late final _git_diff_patchid_init_options = _git_diff_patchid_init_optionsPtr .asFunction, int)>(); @@ -21045,8 +21013,8 @@ class Libgit2 { late final _git_fetch_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_fetch_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_fetch_init_options'); late final _git_fetch_init_options = _git_fetch_init_optionsPtr .asFunction, int)>(); @@ -21062,8 +21030,8 @@ class Libgit2 { late final _git_indexer_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_indexer_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_indexer_init_options'); late final _git_indexer_init_options = _git_indexer_init_optionsPtr .asFunction, int)>(); @@ -21079,8 +21047,8 @@ class Libgit2 { late final _git_merge_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_merge_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_merge_init_options'); late final _git_merge_init_options = _git_merge_init_optionsPtr .asFunction, int)>(); @@ -21096,8 +21064,8 @@ class Libgit2 { late final _git_merge_file_init_inputPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_merge_file_init_input'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_merge_file_init_input'); late final _git_merge_file_init_input = _git_merge_file_init_inputPtr .asFunction, int)>(); @@ -21113,8 +21081,8 @@ class Libgit2 { late final _git_merge_file_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_merge_file_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_merge_file_init_options'); late final _git_merge_file_init_options = _git_merge_file_init_optionsPtr .asFunction, int)>(); @@ -21130,8 +21098,8 @@ class Libgit2 { late final _git_proxy_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_proxy_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_proxy_init_options'); late final _git_proxy_init_options = _git_proxy_init_optionsPtr .asFunction, int)>(); @@ -21147,8 +21115,8 @@ class Libgit2 { late final _git_push_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_push_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_push_init_options'); late final _git_push_init_options = _git_push_init_optionsPtr .asFunction, int)>(); @@ -21164,8 +21132,8 @@ class Libgit2 { late final _git_rebase_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_rebase_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_rebase_init_options'); late final _git_rebase_init_options = _git_rebase_init_optionsPtr .asFunction, int)>(); @@ -21181,8 +21149,8 @@ class Libgit2 { late final _git_remote_create_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_remote_create_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_remote_create_init_options'); late final _git_remote_create_init_options = _git_remote_create_init_optionsPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -21199,8 +21167,8 @@ class Libgit2 { late final _git_repository_init_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_repository_init_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_repository_init_init_options'); late final _git_repository_init_init_options = _git_repository_init_init_optionsPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -21217,8 +21185,8 @@ class Libgit2 { late final _git_revert_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_revert_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_revert_init_options'); late final _git_revert_init_options = _git_revert_init_optionsPtr .asFunction, int)>(); @@ -21234,8 +21202,8 @@ class Libgit2 { late final _git_stash_apply_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_stash_apply_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_stash_apply_init_options'); late final _git_stash_apply_init_options = _git_stash_apply_init_optionsPtr .asFunction, int)>(); @@ -21251,8 +21219,8 @@ class Libgit2 { late final _git_status_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_status_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_status_init_options'); late final _git_status_init_options = _git_status_init_optionsPtr .asFunction, int)>(); @@ -21268,8 +21236,8 @@ class Libgit2 { late final _git_submodule_update_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_submodule_update_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_submodule_update_init_options'); late final _git_submodule_update_init_options = _git_submodule_update_init_optionsPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -21286,8 +21254,8 @@ class Libgit2 { late final _git_worktree_add_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_worktree_add_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_worktree_add_init_options'); late final _git_worktree_add_init_options = _git_worktree_add_init_optionsPtr .asFunction, int)>(); @@ -21303,8 +21271,8 @@ class Libgit2 { late final _git_worktree_prune_init_optionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_worktree_prune_init_options'); + ffi.Int32 Function(ffi.Pointer, + ffi.Uint32)>>('git_worktree_prune_init_options'); late final _git_worktree_prune_init_options = _git_worktree_prune_init_optionsPtr.asFunction< int Function(ffi.Pointer, int)>(); @@ -21326,8 +21294,8 @@ class Libgit2 { int patch_idx, int patch_count, ffi.Pointer commit_id, - ffi.Pointer summary, - ffi.Pointer body, + ffi.Pointer summary, + ffi.Pointer body, ffi.Pointer author, ffi.Pointer opts, ) { @@ -21346,14 +21314,14 @@ class Libgit2 { late final _git_email_create_from_diffPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Size, - ffi.Size, + size_t, + size_t, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( 'git_email_create_from_diff'); @@ -21365,8 +21333,8 @@ class Libgit2 { int, int, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -21390,7 +21358,7 @@ class Libgit2 { late final _git_email_create_from_commitPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>( 'git_email_create_from_commit'); late final _git_email_create_from_commit = @@ -21413,7 +21381,7 @@ class Libgit2 { } late final _git_libgit2_initPtr = - _lookup>('git_libgit2_init'); + _lookup>('git_libgit2_init'); late final _git_libgit2_init = _git_libgit2_initPtr.asFunction(); @@ -21431,7 +21399,7 @@ class Libgit2 { } late final _git_libgit2_shutdownPtr = - _lookup>('git_libgit2_shutdown'); + _lookup>('git_libgit2_shutdown'); late final _git_libgit2_shutdown = _git_libgit2_shutdownPtr.asFunction(); @@ -21449,8 +21417,8 @@ class Libgit2 { /// @param upstream the commit for upstream /// @return 0 or an error code. int git_graph_ahead_behind( - ffi.Pointer ahead, - ffi.Pointer behind, + ffi.Pointer ahead, + ffi.Pointer behind, ffi.Pointer repo, ffi.Pointer local, ffi.Pointer upstream, @@ -21466,16 +21434,16 @@ class Libgit2 { late final _git_graph_ahead_behindPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_graph_ahead_behind'); late final _git_graph_ahead_behind = _git_graph_ahead_behindPtr.asFunction< int Function( - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -21504,7 +21472,7 @@ class Libgit2 { late final _git_graph_descendant_ofPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_graph_descendant_of'); late final _git_graph_descendant_of = _git_graph_descendant_ofPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -21535,8 +21503,8 @@ class Libgit2 { late final _git_graph_reachable_from_anyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('git_graph_reachable_from_any'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, size_t)>>('git_graph_reachable_from_any'); late final _git_graph_reachable_from_any = _git_graph_reachable_from_anyPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -21564,7 +21532,7 @@ class Libgit2 { /// @return 0 on success int git_ignore_add_rule( ffi.Pointer repo, - ffi.Pointer rules, + ffi.Pointer rules, ) { return _git_ignore_add_rule( repo, @@ -21574,10 +21542,10 @@ class Libgit2 { late final _git_ignore_add_rulePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_ignore_add_rule'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_ignore_add_rule'); late final _git_ignore_add_rule = _git_ignore_add_rulePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Clear ignore rules that were explicitly added. /// @@ -21597,7 +21565,7 @@ class Libgit2 { } late final _git_ignore_clear_internal_rulesPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_ignore_clear_internal_rules'); late final _git_ignore_clear_internal_rules = _git_ignore_clear_internal_rulesPtr @@ -21618,9 +21586,9 @@ class Libgit2 { /// @return 0 if ignore rules could be processed for the file (regardless /// of whether it exists or not), or an error < 0 if they could not. int git_ignore_path_is_ignored( - ffi.Pointer ignored, + ffi.Pointer ignored, ffi.Pointer repo, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_ignore_path_is_ignored( ignored, @@ -21631,12 +21599,14 @@ class Libgit2 { late final _git_ignore_path_is_ignoredPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_ignore_path_is_ignored'); + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_ignore_path_is_ignored'); late final _git_ignore_path_is_ignored = _git_ignore_path_is_ignoredPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Allocate a new mailmap object. /// @@ -21655,7 +21625,7 @@ class Libgit2 { late final _git_mailmap_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>)>>('git_mailmap_new'); late final _git_mailmap_new = _git_mailmap_newPtr .asFunction>)>(); @@ -21688,10 +21658,10 @@ class Libgit2 { /// @return 0 on success, or an error code int git_mailmap_add_entry( ffi.Pointer mm, - ffi.Pointer real_name, - ffi.Pointer real_email, - ffi.Pointer replace_name, - ffi.Pointer replace_email, + ffi.Pointer real_name, + ffi.Pointer real_email, + ffi.Pointer replace_name, + ffi.Pointer replace_email, ) { return _git_mailmap_add_entry( mm, @@ -21704,19 +21674,19 @@ class Libgit2 { late final _git_mailmap_add_entryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_mailmap_add_entry'); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('git_mailmap_add_entry'); late final _git_mailmap_add_entry = _git_mailmap_add_entryPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); /// Create a new mailmap instance containing a single mailmap file /// @@ -21726,7 +21696,7 @@ class Libgit2 { /// @return 0 on success, or an error code int git_mailmap_from_buffer( ffi.Pointer> out, - ffi.Pointer buf, + ffi.Pointer buf, int len, ) { return _git_mailmap_from_buffer( @@ -21738,11 +21708,11 @@ class Libgit2 { late final _git_mailmap_from_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.Size)>>('git_mailmap_from_buffer'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, size_t)>>('git_mailmap_from_buffer'); late final _git_mailmap_from_buffer = _git_mailmap_from_bufferPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer, int)>(); + ffi.Pointer>, ffi.Pointer, int)>(); /// Create a new mailmap instance from a repository, loading mailmap files based /// on the repository's configuration. @@ -21768,7 +21738,7 @@ class Libgit2 { late final _git_mailmap_from_repositoryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_mailmap_from_repository'); late final _git_mailmap_from_repository = _git_mailmap_from_repositoryPtr.asFunction< @@ -21786,11 +21756,11 @@ class Libgit2 { /// @param email the email to look up /// @return 0 on success, or an error code int git_mailmap_resolve( - ffi.Pointer> real_name, - ffi.Pointer> real_email, + ffi.Pointer> real_name, + ffi.Pointer> real_email, ffi.Pointer mm, - ffi.Pointer name, - ffi.Pointer email, + ffi.Pointer name, + ffi.Pointer email, ) { return _git_mailmap_resolve( real_name, @@ -21803,19 +21773,19 @@ class Libgit2 { late final _git_mailmap_resolvePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - ffi.Pointer>, + ffi.Int32 Function( + ffi.Pointer>, + ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('git_mailmap_resolve'); + ffi.Pointer, + ffi.Pointer)>>('git_mailmap_resolve'); late final _git_mailmap_resolve = _git_mailmap_resolvePtr.asFunction< int Function( - ffi.Pointer>, - ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + ffi.Pointer)>(); /// Resolve a signature to use real names and emails with a mailmap. /// @@ -21839,7 +21809,7 @@ class Libgit2 { late final _git_mailmap_resolve_signaturePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_mailmap_resolve_signature'); @@ -21865,7 +21835,7 @@ class Libgit2 { /// @return 0 or an error code. int git_message_prettify( ffi.Pointer out, - ffi.Pointer message, + ffi.Pointer message, int strip_comments, int comment_char, ) { @@ -21879,10 +21849,10 @@ class Libgit2 { late final _git_message_prettifyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Char)>>('git_message_prettify'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Int8)>>('git_message_prettify'); late final _git_message_prettify = _git_message_prettifyPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); /// Parse trailers out of a message, filling the array pointed to by +arr+. /// @@ -21895,7 +21865,7 @@ class Libgit2 { /// @return 0 on success, or non-zero on error. int git_message_trailers( ffi.Pointer arr, - ffi.Pointer message, + ffi.Pointer message, ) { return _git_message_trailers( arr, @@ -21905,11 +21875,11 @@ class Libgit2 { late final _git_message_trailersPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_message_trailers'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_message_trailers'); late final _git_message_trailers = _git_message_trailersPtr.asFunction< int Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Clean's up any allocated memory in the git_message_trailer_array filled by /// a call to git_message_trailers. @@ -21944,7 +21914,7 @@ class Libgit2 { int git_note_iterator_new( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer notes_ref, + ffi.Pointer notes_ref, ) { return _git_note_iterator_new( out, @@ -21955,13 +21925,13 @@ class Libgit2 { late final _git_note_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_note_iterator_new'); + ffi.Pointer)>>('git_note_iterator_new'); late final _git_note_iterator_new = _git_note_iterator_newPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Creates a new iterator for notes from a commit /// @@ -21983,7 +21953,7 @@ class Libgit2 { late final _git_note_commit_iterator_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_note_commit_iterator_new'); late final _git_note_commit_iterator_new = _git_note_commit_iterator_newPtr.asFunction< @@ -22031,7 +22001,7 @@ class Libgit2 { late final _git_note_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_note_next'); late final _git_note_next = _git_note_nextPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -22051,7 +22021,7 @@ class Libgit2 { int git_note_read( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer notes_ref, + ffi.Pointer notes_ref, ffi.Pointer oid, ) { return _git_note_read( @@ -22064,16 +22034,16 @@ class Libgit2 { late final _git_note_readPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_note_read'); late final _git_note_read = _git_note_readPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Read the note for an object from a note commit @@ -22102,7 +22072,7 @@ class Libgit2 { late final _git_note_commit_readPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, @@ -22156,7 +22126,7 @@ class Libgit2 { /// /// @param note the note /// @return the note message - ffi.Pointer git_note_message( + ffi.Pointer git_note_message( ffi.Pointer note, ) { return _git_note_message( @@ -22166,10 +22136,10 @@ class Libgit2 { late final _git_note_messagePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_note_message'); late final _git_note_message = _git_note_messagePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the note object's id /// @@ -22205,11 +22175,11 @@ class Libgit2 { int git_note_create( ffi.Pointer out, ffi.Pointer repo, - ffi.Pointer notes_ref, + ffi.Pointer notes_ref, ffi.Pointer author, ffi.Pointer committer, ffi.Pointer oid, - ffi.Pointer note, + ffi.Pointer note, int force, ) { return _git_note_create( @@ -22226,24 +22196,24 @@ class Libgit2 { late final _git_note_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('git_note_create'); + ffi.Pointer, + ffi.Int32)>>('git_note_create'); late final _git_note_create = _git_note_createPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int)>(); /// Add a note for an object from a commit @@ -22272,7 +22242,7 @@ class Libgit2 { ffi.Pointer author, ffi.Pointer committer, ffi.Pointer oid, - ffi.Pointer note, + ffi.Pointer note, int allow_note_overwrite, ) { return _git_note_commit_create( @@ -22290,7 +22260,7 @@ class Libgit2 { late final _git_note_commit_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -22298,8 +22268,8 @@ class Libgit2 { ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('git_note_commit_create'); + ffi.Pointer, + ffi.Int32)>>('git_note_commit_create'); late final _git_note_commit_create = _git_note_commit_createPtr.asFunction< int Function( ffi.Pointer, @@ -22309,7 +22279,7 @@ class Libgit2 { ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int)>(); /// Remove the note for an object @@ -22324,7 +22294,7 @@ class Libgit2 { /// @return 0 or an error code int git_note_remove( ffi.Pointer repo, - ffi.Pointer notes_ref, + ffi.Pointer notes_ref, ffi.Pointer author, ffi.Pointer committer, ffi.Pointer oid, @@ -22340,16 +22310,16 @@ class Libgit2 { late final _git_note_removePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_note_remove'); late final _git_note_remove = _git_note_removePtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -22390,7 +22360,7 @@ class Libgit2 { late final _git_note_commit_removePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -22441,7 +22411,7 @@ class Libgit2 { late final _git_note_default_refPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_note_default_ref'); late final _git_note_default_ref = _git_note_default_refPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -22462,7 +22432,7 @@ class Libgit2 { /// @return 0 on success, non-zero callback return value, or error code int git_note_foreach( ffi.Pointer repo, - ffi.Pointer notes_ref, + ffi.Pointer notes_ref, git_note_foreach_cb note_cb, ffi.Pointer payload, ) { @@ -22476,10 +22446,10 @@ class Libgit2 { late final _git_note_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, git_note_foreach_cb, ffi.Pointer)>>('git_note_foreach'); late final _git_note_foreach = _git_note_foreachPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, git_note_foreach_cb, ffi.Pointer)>(); /// Create a new object database with no backends. @@ -22500,7 +22470,8 @@ class Libgit2 { late final _git_odb_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>)>>('git_odb_new'); + ffi.Int32 Function( + ffi.Pointer>)>>('git_odb_new'); late final _git_odb_new = _git_odb_newPtr .asFunction>)>(); @@ -22520,7 +22491,7 @@ class Libgit2 { /// @return 0 or an error code int git_odb_open( ffi.Pointer> out, - ffi.Pointer objects_dir, + ffi.Pointer objects_dir, ) { return _git_odb_open( out, @@ -22530,10 +22501,10 @@ class Libgit2 { late final _git_odb_openPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_odb_open'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_odb_open'); late final _git_odb_open = _git_odb_openPtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer)>(); + int Function(ffi.Pointer>, ffi.Pointer)>(); /// Add an on-disk alternate to an existing Object DB. /// @@ -22550,7 +22521,7 @@ class Libgit2 { /// @return 0 on success, error code otherwise int git_odb_add_disk_alternate( ffi.Pointer odb, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_odb_add_disk_alternate( odb, @@ -22560,10 +22531,10 @@ class Libgit2 { late final _git_odb_add_disk_alternatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_odb_add_disk_alternate'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_odb_add_disk_alternate'); late final _git_odb_add_disk_alternate = _git_odb_add_disk_alternatePtr - .asFunction, ffi.Pointer)>(); + .asFunction, ffi.Pointer)>(); /// Close an open object database. /// @@ -22610,7 +22581,7 @@ class Libgit2 { late final _git_odb_readPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_odb_read'); late final _git_odb_read = _git_odb_readPtr.asFunction< int Function(ffi.Pointer>, @@ -22656,11 +22627,11 @@ class Libgit2 { late final _git_odb_read_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_odb_read_prefix'); + size_t)>>('git_odb_read_prefix'); late final _git_odb_read_prefix = _git_odb_read_prefixPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, ffi.Pointer, int)>(); @@ -22681,7 +22652,7 @@ class Libgit2 { /// @return 0 if the object was read, GIT_ENOTFOUND if the object is not /// in the database. int git_odb_read_header( - ffi.Pointer len_out, + ffi.Pointer len_out, ffi.Pointer type_out, ffi.Pointer db, ffi.Pointer id, @@ -22696,13 +22667,13 @@ class Libgit2 { late final _git_odb_read_headerPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_odb_read_header'); late final _git_odb_read_header = _git_odb_read_headerPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); /// Determine if the given object can be found in the object database. @@ -22722,7 +22693,7 @@ class Libgit2 { late final _git_odb_existsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>('git_odb_exists'); late final _git_odb_exists = _git_odb_existsPtr .asFunction, ffi.Pointer)>(); @@ -22748,8 +22719,8 @@ class Libgit2 { late final _git_odb_exists_extPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt)>>('git_odb_exists_ext'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Uint32)>>('git_odb_exists_ext'); late final _git_odb_exists_ext = _git_odb_exists_extPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -22778,8 +22749,8 @@ class Libgit2 { late final _git_odb_exists_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('git_odb_exists_prefix'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, size_t)>>('git_odb_exists_prefix'); late final _git_odb_exists_prefix = _git_odb_exists_prefixPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(); @@ -22815,8 +22786,8 @@ class Libgit2 { late final _git_odb_expand_idsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_odb_expand_ids'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer, size_t)>>('git_odb_expand_ids'); late final _git_odb_expand_ids = _git_odb_expand_idsPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, int)>(); @@ -22846,7 +22817,7 @@ class Libgit2 { } late final _git_odb_refreshPtr = - _lookup)>>( + _lookup)>>( 'git_odb_refresh'); late final _git_odb_refresh = _git_odb_refreshPtr.asFunction)>(); @@ -22876,7 +22847,7 @@ class Libgit2 { late final _git_odb_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_odb_foreach_cb, + ffi.Int32 Function(ffi.Pointer, git_odb_foreach_cb, ffi.Pointer)>>('git_odb_foreach'); late final _git_odb_foreach = _git_odb_foreachPtr.asFunction< int Function( @@ -22916,8 +22887,8 @@ class Libgit2 { late final _git_odb_writePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size, ffi.Int32)>>('git_odb_write'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, size_t, ffi.Int32)>>('git_odb_write'); late final _git_odb_write = _git_odb_writePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int, int)>(); @@ -22957,7 +22928,7 @@ class Libgit2 { late final _git_odb_open_wstreamPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, git_object_size_t, @@ -22977,7 +22948,7 @@ class Libgit2 { /// @return 0 if the write succeeded, error code otherwise int git_odb_stream_write( ffi.Pointer stream, - ffi.Pointer buffer, + ffi.Pointer buffer, int len, ) { return _git_odb_stream_write( @@ -22989,10 +22960,10 @@ class Libgit2 { late final _git_odb_stream_writePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_odb_stream_write'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t)>>('git_odb_stream_write'); late final _git_odb_stream_write = _git_odb_stream_writePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Finish writing to an odb stream /// @@ -23017,7 +22988,7 @@ class Libgit2 { late final _git_odb_stream_finalize_writePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_odb_stream_finalize_write'); late final _git_odb_stream_finalize_write = _git_odb_stream_finalize_writePtr.asFunction< @@ -23033,7 +23004,7 @@ class Libgit2 { /// @return 0 if the read succeeded, error code otherwise int git_odb_stream_read( ffi.Pointer stream, - ffi.Pointer buffer, + ffi.Pointer buffer, int len, ) { return _git_odb_stream_read( @@ -23045,10 +23016,10 @@ class Libgit2 { late final _git_odb_stream_readPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_odb_stream_read'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t)>>('git_odb_stream_read'); late final _git_odb_stream_read = _git_odb_stream_readPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Free an odb stream /// @@ -23093,7 +23064,7 @@ class Libgit2 { /// @return 0 if the stream was created, error code otherwise int git_odb_open_rstream( ffi.Pointer> out, - ffi.Pointer len, + ffi.Pointer len, ffi.Pointer type, ffi.Pointer db, ffi.Pointer oid, @@ -23109,16 +23080,16 @@ class Libgit2 { late final _git_odb_open_rstreamPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_odb_open_rstream'); late final _git_odb_open_rstream = _git_odb_open_rstreamPtr.asFunction< int Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); @@ -23156,7 +23127,7 @@ class Libgit2 { late final _git_odb_write_packPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, git_indexer_progress_cb, @@ -23187,7 +23158,7 @@ class Libgit2 { } late final _git_odb_write_multi_pack_indexPtr = - _lookup)>>( + _lookup)>>( 'git_odb_write_multi_pack_index'); late final _git_odb_write_multi_pack_index = _git_odb_write_multi_pack_indexPtr @@ -23219,8 +23190,8 @@ class Libgit2 { late final _git_odb_hashPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Int32)>>('git_odb_hash'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + size_t, ffi.Int32)>>('git_odb_hash'); late final _git_odb_hash = _git_odb_hashPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, int)>(); @@ -23237,7 +23208,7 @@ class Libgit2 { /// @return 0 or an error code int git_odb_hashfile( ffi.Pointer out, - ffi.Pointer path, + ffi.Pointer path, int type, ) { return _git_odb_hashfile( @@ -23249,10 +23220,10 @@ class Libgit2 { late final _git_odb_hashfilePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>>('git_odb_hashfile'); late final _git_odb_hashfile = _git_odb_hashfilePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer, ffi.Pointer, int)>(); /// Create a copy of an odb_object /// @@ -23276,7 +23247,7 @@ class Libgit2 { late final _git_odb_object_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_odb_object_dup'); late final _git_odb_object_dup = _git_odb_object_dupPtr.asFunction< int Function(ffi.Pointer>, @@ -23362,9 +23333,9 @@ class Libgit2 { ); } - late final _git_odb_object_sizePtr = _lookup< - ffi.NativeFunction)>>( - 'git_odb_object_size'); + late final _git_odb_object_sizePtr = + _lookup)>>( + 'git_odb_object_size'); late final _git_odb_object_size = _git_odb_object_sizePtr .asFunction)>(); @@ -23411,8 +23382,8 @@ class Libgit2 { late final _git_odb_add_backendPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_odb_add_backend'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('git_odb_add_backend'); late final _git_odb_add_backend = _git_odb_add_backendPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -23447,8 +23418,8 @@ class Libgit2 { late final _git_odb_add_alternatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_odb_add_alternate'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32)>>('git_odb_add_alternate'); late final _git_odb_add_alternate = _git_odb_add_alternatePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); @@ -23465,7 +23436,7 @@ class Libgit2 { } late final _git_odb_num_backendsPtr = - _lookup)>>( + _lookup)>>( 'git_odb_num_backends'); late final _git_odb_num_backends = _git_odb_num_backendsPtr.asFunction)>(); @@ -23490,8 +23461,8 @@ class Libgit2 { late final _git_odb_get_backendPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.Size)>>('git_odb_get_backend'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, size_t)>>('git_odb_get_backend'); late final _git_odb_get_backend = _git_odb_get_backendPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, int)>(); @@ -23519,7 +23490,7 @@ class Libgit2 { late final _git_odb_set_commit_graphPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_odb_set_commit_graph'); late final _git_odb_set_commit_graph = _git_odb_set_commit_graphPtr.asFunction< @@ -23533,7 +23504,7 @@ class Libgit2 { /// @return 0 or an error code int git_odb_backend_pack( ffi.Pointer> out, - ffi.Pointer objects_dir, + ffi.Pointer objects_dir, ) { return _git_odb_backend_pack( out, @@ -23543,11 +23514,11 @@ class Libgit2 { late final _git_odb_backend_packPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_odb_backend_pack'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_odb_backend_pack'); late final _git_odb_backend_pack = _git_odb_backend_packPtr.asFunction< int Function( - ffi.Pointer>, ffi.Pointer)>(); + ffi.Pointer>, ffi.Pointer)>(); /// Create a backend for loose objects /// @@ -23561,7 +23532,7 @@ class Libgit2 { /// @return 0 or an error code int git_odb_backend_loose( ffi.Pointer> out, - ffi.Pointer objects_dir, + ffi.Pointer objects_dir, int compression_level, int do_fsync, int dir_mode, @@ -23579,16 +23550,16 @@ class Libgit2 { late final _git_odb_backend_loosePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Int, - ffi.Int, - ffi.UnsignedInt, - ffi.UnsignedInt)>>('git_odb_backend_loose'); + ffi.Pointer, + ffi.Int32, + ffi.Int32, + ffi.Uint32, + ffi.Uint32)>>('git_odb_backend_loose'); late final _git_odb_backend_loose = _git_odb_backend_loosePtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, int, int, int, int)>(); + ffi.Pointer, int, int, int, int)>(); /// Create a backend out of a single packfile /// @@ -23601,7 +23572,7 @@ class Libgit2 { /// @return 0 or an error code int git_odb_backend_one_pack( ffi.Pointer> out, - ffi.Pointer index_file, + ffi.Pointer index_file, ) { return _git_odb_backend_one_pack( out, @@ -23611,12 +23582,12 @@ class Libgit2 { late final _git_odb_backend_one_packPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_odb_backend_one_pack'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_odb_backend_one_pack'); late final _git_odb_backend_one_pack = _git_odb_backend_one_packPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Get the repository associated with this patch. May be NULL. /// @@ -23669,8 +23640,8 @@ class Libgit2 { late final _git_patch_from_diffPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.Size)>>('git_patch_from_diff'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, size_t)>>('git_patch_from_diff'); late final _git_patch_from_diff = _git_patch_from_diffPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, int)>(); @@ -23692,9 +23663,9 @@ class Libgit2 { int git_patch_from_blobs( ffi.Pointer> out, ffi.Pointer old_blob, - ffi.Pointer old_as_path, + ffi.Pointer old_as_path, ffi.Pointer new_blob, - ffi.Pointer new_as_path, + ffi.Pointer new_as_path, ffi.Pointer opts, ) { return _git_patch_from_blobs( @@ -23709,20 +23680,20 @@ class Libgit2 { late final _git_patch_from_blobsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_patch_from_blobs'); late final _git_patch_from_blobs = _git_patch_from_blobsPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Directly generate a patch from the difference between a blob and a buffer. @@ -23743,10 +23714,10 @@ class Libgit2 { int git_patch_from_blob_and_buffer( ffi.Pointer> out, ffi.Pointer old_blob, - ffi.Pointer old_as_path, + ffi.Pointer old_as_path, ffi.Pointer buffer, int buffer_len, - ffi.Pointer buffer_as_path, + ffi.Pointer buffer_as_path, ffi.Pointer opts, ) { return _git_patch_from_blob_and_buffer( @@ -23762,13 +23733,13 @@ class Libgit2 { late final _git_patch_from_blob_and_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Size, - ffi.Pointer, + size_t, + ffi.Pointer, ffi.Pointer)>>( 'git_patch_from_blob_and_buffer'); late final _git_patch_from_blob_and_buffer = @@ -23776,10 +23747,10 @@ class Libgit2 { int Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Directly generate a patch from the difference between two buffers. @@ -23802,10 +23773,10 @@ class Libgit2 { ffi.Pointer> out, ffi.Pointer old_buffer, int old_len, - ffi.Pointer old_as_path, + ffi.Pointer old_as_path, ffi.Pointer new_buffer, int new_len, - ffi.Pointer new_as_path, + ffi.Pointer new_as_path, ffi.Pointer opts, ) { return _git_patch_from_buffers( @@ -23822,24 +23793,24 @@ class Libgit2 { late final _git_patch_from_buffersPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Size, - ffi.Pointer, + size_t, + ffi.Pointer, ffi.Pointer, - ffi.Size, - ffi.Pointer, + size_t, + ffi.Pointer, ffi.Pointer)>>('git_patch_from_buffers'); late final _git_patch_from_buffers = _git_patch_from_buffersPtr.asFunction< int Function( ffi.Pointer>, ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Free a git_patch object. @@ -23892,7 +23863,7 @@ class Libgit2 { } late final _git_patch_num_hunksPtr = - _lookup)>>( + _lookup)>>( 'git_patch_num_hunks'); late final _git_patch_num_hunks = _git_patch_num_hunksPtr .asFunction)>(); @@ -23912,9 +23883,9 @@ class Libgit2 { /// @param patch The git_patch object /// @return 0 on success, <0 on error int git_patch_line_stats( - ffi.Pointer total_context, - ffi.Pointer total_additions, - ffi.Pointer total_deletions, + ffi.Pointer total_context, + ffi.Pointer total_additions, + ffi.Pointer total_deletions, ffi.Pointer patch, ) { return _git_patch_line_stats( @@ -23927,14 +23898,14 @@ class Libgit2 { late final _git_patch_line_statsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_patch_line_stats'); late final _git_patch_line_stats = _git_patch_line_statsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); /// Get the information about a hunk in a patch /// @@ -23949,7 +23920,7 @@ class Libgit2 { /// @return 0 on success, GIT_ENOTFOUND if hunk_idx out of range, <0 on error int git_patch_get_hunk( ffi.Pointer> out, - ffi.Pointer lines_in_hunk, + ffi.Pointer lines_in_hunk, ffi.Pointer patch, int hunk_idx, ) { @@ -23963,14 +23934,14 @@ class Libgit2 { late final _git_patch_get_hunkPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_patch_get_hunk'); + size_t)>>('git_patch_get_hunk'); late final _git_patch_get_hunk = _git_patch_get_hunkPtr.asFunction< - int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer, int)>(); + int Function(ffi.Pointer>, ffi.Pointer, + ffi.Pointer, int)>(); /// Get the number of lines in a hunk. /// @@ -23989,8 +23960,8 @@ class Libgit2 { late final _git_patch_num_lines_in_hunkPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Size)>>('git_patch_num_lines_in_hunk'); + ffi.Int32 Function( + ffi.Pointer, size_t)>>('git_patch_num_lines_in_hunk'); late final _git_patch_num_lines_in_hunk = _git_patch_num_lines_in_hunkPtr .asFunction, int)>(); @@ -24022,11 +23993,11 @@ class Libgit2 { late final _git_patch_get_line_in_hunkPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Size, - ffi.Size)>>('git_patch_get_line_in_hunk'); + size_t, + size_t)>>('git_patch_get_line_in_hunk'); late final _git_patch_get_line_in_hunk = _git_patch_get_line_in_hunkPtr.asFunction< int Function(ffi.Pointer>, @@ -24062,8 +24033,8 @@ class Libgit2 { late final _git_patch_sizePtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Int, ffi.Int, - ffi.Int)>>('git_patch_size'); + size_t Function(ffi.Pointer, ffi.Int32, ffi.Int32, + ffi.Int32)>>('git_patch_size'); late final _git_patch_size = _git_patch_sizePtr .asFunction, int, int, int)>(); @@ -24091,7 +24062,7 @@ class Libgit2 { late final _git_patch_printPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_diff_line_cb, + ffi.Int32 Function(ffi.Pointer, git_diff_line_cb, ffi.Pointer)>>('git_patch_print'); late final _git_patch_print = _git_patch_printPtr.asFunction< int Function( @@ -24114,7 +24085,7 @@ class Libgit2 { late final _git_patch_to_bufPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_patch_to_buf'); late final _git_patch_to_buf = _git_patch_to_bufPtr .asFunction, ffi.Pointer)>(); @@ -24136,7 +24107,7 @@ class Libgit2 { late final _git_pathspec_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_pathspec_new'); late final _git_pathspec_new = _git_pathspec_newPtr.asFunction< int Function( @@ -24173,7 +24144,7 @@ class Libgit2 { int git_pathspec_matches_path( ffi.Pointer ps, int flags, - ffi.Pointer path, + ffi.Pointer path, ) { return _git_pathspec_matches_path( ps, @@ -24184,12 +24155,12 @@ class Libgit2 { late final _git_pathspec_matches_pathPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Uint32, - ffi.Pointer)>>('git_pathspec_matches_path'); + ffi.Int32 Function(ffi.Pointer, ffi.Uint32, + ffi.Pointer)>>('git_pathspec_matches_path'); late final _git_pathspec_matches_path = _git_pathspec_matches_pathPtr.asFunction< int Function( - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Pointer, int, ffi.Pointer)>(); /// Match a pathspec against the working directory of a repository. /// @@ -24227,7 +24198,7 @@ class Libgit2 { late final _git_pathspec_match_workdirPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Uint32, @@ -24274,7 +24245,7 @@ class Libgit2 { late final _git_pathspec_match_indexPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Uint32, @@ -24316,7 +24287,7 @@ class Libgit2 { late final _git_pathspec_match_treePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Uint32, @@ -24357,7 +24328,7 @@ class Libgit2 { late final _git_pathspec_match_diffPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Uint32, @@ -24398,7 +24369,7 @@ class Libgit2 { late final _git_pathspec_match_list_entrycountPtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer)>>( + size_t Function(ffi.Pointer)>>( 'git_pathspec_match_list_entrycount'); late final _git_pathspec_match_list_entrycount = _git_pathspec_match_list_entrycountPtr @@ -24412,7 +24383,7 @@ class Libgit2 { /// @param m The git_pathspec_match_list object /// @param pos The index into the list /// @return The filename of the match - ffi.Pointer git_pathspec_match_list_entry( + ffi.Pointer git_pathspec_match_list_entry( ffi.Pointer m, int pos, ) { @@ -24424,11 +24395,11 @@ class Libgit2 { late final _git_pathspec_match_list_entryPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Size)>>('git_pathspec_match_list_entry'); + ffi.Pointer Function(ffi.Pointer, + size_t)>>('git_pathspec_match_list_entry'); late final _git_pathspec_match_list_entry = _git_pathspec_match_list_entryPtr.asFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, int)>(); /// Get a matching diff delta by position. @@ -24453,7 +24424,7 @@ class Libgit2 { ffi.NativeFunction< ffi.Pointer Function( ffi.Pointer, - ffi.Size)>>('git_pathspec_match_list_diff_entry'); + size_t)>>('git_pathspec_match_list_diff_entry'); late final _git_pathspec_match_list_diff_entry = _git_pathspec_match_list_diff_entryPtr.asFunction< ffi.Pointer Function( @@ -24476,7 +24447,7 @@ class Libgit2 { late final _git_pathspec_match_list_failed_entrycountPtr = _lookup< ffi.NativeFunction< - ffi.Size Function(ffi.Pointer)>>( + size_t Function(ffi.Pointer)>>( 'git_pathspec_match_list_failed_entrycount'); late final _git_pathspec_match_list_failed_entrycount = _git_pathspec_match_list_failed_entrycountPtr @@ -24489,7 +24460,7 @@ class Libgit2 { /// @param m The git_pathspec_match_list object /// @param pos The index into the failed items /// @return The pathspec pattern that didn't match anything - ffi.Pointer git_pathspec_match_list_failed_entry( + ffi.Pointer git_pathspec_match_list_failed_entry( ffi.Pointer m, int pos, ) { @@ -24501,11 +24472,11 @@ class Libgit2 { late final _git_pathspec_match_list_failed_entryPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Size)>>('git_pathspec_match_list_failed_entry'); + ffi.Pointer Function(ffi.Pointer, + size_t)>>('git_pathspec_match_list_failed_entry'); late final _git_pathspec_match_list_failed_entry = _git_pathspec_match_list_failed_entryPtr.asFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer, int)>(); /// Create a new reference database with no backends. @@ -24529,7 +24500,7 @@ class Libgit2 { late final _git_refdb_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_refdb_new'); late final _git_refdb_new = _git_refdb_newPtr.asFunction< int Function( @@ -24557,7 +24528,7 @@ class Libgit2 { late final _git_refdb_openPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_refdb_open'); late final _git_refdb_open = _git_refdb_openPtr.asFunction< int Function( @@ -24578,7 +24549,7 @@ class Libgit2 { } late final _git_refdb_compressPtr = - _lookup)>>( + _lookup)>>( 'git_refdb_compress'); late final _git_refdb_compress = _git_refdb_compressPtr.asFunction)>(); @@ -24616,7 +24587,7 @@ class Libgit2 { int git_reflog_read( ffi.Pointer> out, ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_reflog_read( out, @@ -24627,13 +24598,13 @@ class Libgit2 { late final _git_reflog_readPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>>('git_reflog_read'); + ffi.Pointer)>>('git_reflog_read'); late final _git_reflog_read = _git_reflog_readPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Write an existing in-memory reflog object back to disk /// using an atomic file lock. @@ -24649,7 +24620,7 @@ class Libgit2 { } late final _git_reflog_writePtr = - _lookup)>>( + _lookup)>>( 'git_reflog_write'); late final _git_reflog_write = _git_reflog_writePtr.asFunction)>(); @@ -24667,7 +24638,7 @@ class Libgit2 { ffi.Pointer reflog, ffi.Pointer id, ffi.Pointer committer, - ffi.Pointer msg, + ffi.Pointer msg, ) { return _git_reflog_append( reflog, @@ -24679,14 +24650,14 @@ class Libgit2 { late final _git_reflog_appendPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_reflog_append'); + ffi.Pointer)>>('git_reflog_append'); late final _git_reflog_append = _git_reflog_appendPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Rename a reflog /// @@ -24701,8 +24672,8 @@ class Libgit2 { /// @return 0 on success, GIT_EINVALIDSPEC or an error code int git_reflog_rename( ffi.Pointer repo, - ffi.Pointer old_name, - ffi.Pointer name, + ffi.Pointer old_name, + ffi.Pointer name, ) { return _git_reflog_rename( repo, @@ -24713,11 +24684,11 @@ class Libgit2 { late final _git_reflog_renamePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_reflog_rename'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('git_reflog_rename'); late final _git_reflog_rename = _git_reflog_renamePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); /// Delete the reflog for the given reference /// @@ -24726,7 +24697,7 @@ class Libgit2 { /// @return 0 or an error code int git_reflog_delete( ffi.Pointer repo, - ffi.Pointer name, + ffi.Pointer name, ) { return _git_reflog_delete( repo, @@ -24736,10 +24707,10 @@ class Libgit2 { late final _git_reflog_deletePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_reflog_delete'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_reflog_delete'); late final _git_reflog_delete = _git_reflog_deletePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Get the number of log entries in a reflog /// @@ -24754,7 +24725,7 @@ class Libgit2 { } late final _git_reflog_entrycountPtr = - _lookup)>>( + _lookup)>>( 'git_reflog_entrycount'); late final _git_reflog_entrycount = _git_reflog_entrycountPtr .asFunction)>(); @@ -24781,7 +24752,7 @@ class Libgit2 { late final _git_reflog_entry_byindexPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('git_reflog_entry_byindex'); + ffi.Pointer, size_t)>>('git_reflog_entry_byindex'); late final _git_reflog_entry_byindex = _git_reflog_entry_byindexPtr.asFunction< ffi.Pointer Function( @@ -24816,8 +24787,8 @@ class Libgit2 { late final _git_reflog_dropPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Size, ffi.Int)>>('git_reflog_drop'); + ffi.Int32 Function( + ffi.Pointer, size_t, ffi.Int32)>>('git_reflog_drop'); late final _git_reflog_drop = _git_reflog_dropPtr .asFunction, int, int)>(); @@ -24883,7 +24854,7 @@ class Libgit2 { /// /// @param entry a reflog entry /// @return the log msg - ffi.Pointer git_reflog_entry_message( + ffi.Pointer git_reflog_entry_message( ffi.Pointer entry, ) { return _git_reflog_entry_message( @@ -24893,11 +24864,11 @@ class Libgit2 { late final _git_reflog_entry_messagePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_reflog_entry_message'); late final _git_reflog_entry_message = _git_reflog_entry_messagePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>(); /// Free the reflog /// @@ -24960,8 +24931,11 @@ class Libgit2 { late final _git_resetPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('git_reset'); + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int32, + ffi.Pointer)>>('git_reset'); late final _git_reset = _git_resetPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(); @@ -24992,7 +24966,7 @@ class Libgit2 { late final _git_reset_from_annotatedPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Int32, @@ -25035,7 +25009,9 @@ class Libgit2 { late final _git_reset_defaultPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_reset_default'); late final _git_reset_default = _git_reset_defaultPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, @@ -25069,7 +25045,7 @@ class Libgit2 { late final _git_revwalk_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_revwalk_new'); late final _git_revwalk_new = _git_revwalk_newPtr.asFunction< int Function(ffi.Pointer>, @@ -25096,7 +25072,7 @@ class Libgit2 { } late final _git_revwalk_resetPtr = - _lookup)>>( + _lookup)>>( 'git_revwalk_reset'); late final _git_revwalk_reset = _git_revwalk_resetPtr .asFunction)>(); @@ -25128,7 +25104,7 @@ class Libgit2 { late final _git_revwalk_pushPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_revwalk_push'); late final _git_revwalk_push = _git_revwalk_pushPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -25149,7 +25125,7 @@ class Libgit2 { /// @return 0 or an error code int git_revwalk_push_glob( ffi.Pointer walk, - ffi.Pointer glob, + ffi.Pointer glob, ) { return _git_revwalk_push_glob( walk, @@ -25159,10 +25135,10 @@ class Libgit2 { late final _git_revwalk_push_globPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_revwalk_push_glob'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_revwalk_push_glob'); late final _git_revwalk_push_glob = _git_revwalk_push_globPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Push the repository's HEAD /// @@ -25177,7 +25153,7 @@ class Libgit2 { } late final _git_revwalk_push_headPtr = - _lookup)>>( + _lookup)>>( 'git_revwalk_push_head'); late final _git_revwalk_push_head = _git_revwalk_push_headPtr .asFunction)>(); @@ -25205,7 +25181,7 @@ class Libgit2 { late final _git_revwalk_hidePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_revwalk_hide'); late final _git_revwalk_hide = _git_revwalk_hidePtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -25227,7 +25203,7 @@ class Libgit2 { /// @return 0 or an error code int git_revwalk_hide_glob( ffi.Pointer walk, - ffi.Pointer glob, + ffi.Pointer glob, ) { return _git_revwalk_hide_glob( walk, @@ -25237,10 +25213,10 @@ class Libgit2 { late final _git_revwalk_hide_globPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_revwalk_hide_glob'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_revwalk_hide_glob'); late final _git_revwalk_hide_glob = _git_revwalk_hide_globPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Hide the repository's HEAD /// @@ -25255,7 +25231,7 @@ class Libgit2 { } late final _git_revwalk_hide_headPtr = - _lookup)>>( + _lookup)>>( 'git_revwalk_hide_head'); late final _git_revwalk_hide_head = _git_revwalk_hide_headPtr .asFunction)>(); @@ -25269,7 +25245,7 @@ class Libgit2 { /// @return 0 or an error code int git_revwalk_push_ref( ffi.Pointer walk, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_revwalk_push_ref( walk, @@ -25279,10 +25255,10 @@ class Libgit2 { late final _git_revwalk_push_refPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_revwalk_push_ref'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_revwalk_push_ref'); late final _git_revwalk_push_ref = _git_revwalk_push_refPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Hide the OID pointed to by a reference /// @@ -25293,7 +25269,7 @@ class Libgit2 { /// @return 0 or an error code int git_revwalk_hide_ref( ffi.Pointer walk, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_revwalk_hide_ref( walk, @@ -25303,10 +25279,10 @@ class Libgit2 { late final _git_revwalk_hide_refPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_revwalk_hide_ref'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_revwalk_hide_ref'); late final _git_revwalk_hide_ref = _git_revwalk_hide_refPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Get the next commit from the revision walk. /// @@ -25336,7 +25312,7 @@ class Libgit2 { late final _git_revwalk_nextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_revwalk_next'); late final _git_revwalk_next = _git_revwalk_nextPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -25361,8 +25337,8 @@ class Libgit2 { late final _git_revwalk_sortingPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.UnsignedInt)>>('git_revwalk_sorting'); + ffi.Int32 Function( + ffi.Pointer, ffi.Uint32)>>('git_revwalk_sorting'); late final _git_revwalk_sorting = _git_revwalk_sortingPtr .asFunction, int)>(); @@ -25378,7 +25354,7 @@ class Libgit2 { /// @return 0 or an error code int git_revwalk_push_range( ffi.Pointer walk, - ffi.Pointer range, + ffi.Pointer range, ) { return _git_revwalk_push_range( walk, @@ -25388,10 +25364,10 @@ class Libgit2 { late final _git_revwalk_push_rangePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_revwalk_push_range'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_revwalk_push_range'); late final _git_revwalk_push_range = _git_revwalk_push_rangePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Simplify the history by first-parent /// @@ -25408,7 +25384,7 @@ class Libgit2 { } late final _git_revwalk_simplify_first_parentPtr = - _lookup)>>( + _lookup)>>( 'git_revwalk_simplify_first_parent'); late final _git_revwalk_simplify_first_parent = _git_revwalk_simplify_first_parentPtr @@ -25471,7 +25447,7 @@ class Libgit2 { late final _git_revwalk_add_hide_cbPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_revwalk_hide_cb, + ffi.Int32 Function(ffi.Pointer, git_revwalk_hide_cb, ffi.Pointer)>>('git_revwalk_add_hide_cb'); late final _git_revwalk_add_hide_cb = _git_revwalk_add_hide_cbPtr.asFunction< int Function(ffi.Pointer, git_revwalk_hide_cb, @@ -25492,8 +25468,8 @@ class Libgit2 { /// @return 0 or an error code int git_signature_new( ffi.Pointer> out, - ffi.Pointer name, - ffi.Pointer email, + ffi.Pointer name, + ffi.Pointer email, int time, int offset, ) { @@ -25508,15 +25484,15 @@ class Libgit2 { late final _git_signature_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, git_time_t, - ffi.Int)>>('git_signature_new'); + ffi.Int32)>>('git_signature_new'); late final _git_signature_new = _git_signature_newPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer, int, int)>(); + ffi.Pointer, ffi.Pointer, int, int)>(); /// Create a new action signature with a timestamp of 'now'. /// @@ -25528,8 +25504,8 @@ class Libgit2 { /// @return 0 or an error code int git_signature_now( ffi.Pointer> out, - ffi.Pointer name, - ffi.Pointer email, + ffi.Pointer name, + ffi.Pointer email, ) { return _git_signature_now( out, @@ -25540,13 +25516,13 @@ class Libgit2 { late final _git_signature_nowPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>>('git_signature_now'); + ffi.Pointer, + ffi.Pointer)>>('git_signature_now'); late final _git_signature_now = _git_signature_nowPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer, ffi.Pointer)>(); /// Create a new action signature with default user and now timestamp. /// @@ -25570,7 +25546,7 @@ class Libgit2 { late final _git_signature_defaultPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_signature_default'); late final _git_signature_default = _git_signature_defaultPtr.asFunction< int Function(ffi.Pointer>, @@ -25587,7 +25563,7 @@ class Libgit2 { /// @return 0 on success, GIT_EINVALID if the signature is not parseable, or an error code int git_signature_from_buffer( ffi.Pointer> out, - ffi.Pointer buf, + ffi.Pointer buf, ) { return _git_signature_from_buffer( out, @@ -25597,12 +25573,12 @@ class Libgit2 { late final _git_signature_from_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('git_signature_from_buffer'); + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer)>>('git_signature_from_buffer'); late final _git_signature_from_buffer = _git_signature_from_bufferPtr.asFunction< int Function(ffi.Pointer>, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Create a copy of an existing signature. All internal strings are also /// duplicated. @@ -25624,7 +25600,7 @@ class Libgit2 { late final _git_signature_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_signature_dup'); late final _git_signature_dup = _git_signature_dupPtr.asFunction< int Function(ffi.Pointer>, @@ -25671,7 +25647,7 @@ class Libgit2 { late final _git_tag_lookupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>('git_tag_lookup'); @@ -25705,11 +25681,11 @@ class Libgit2 { late final _git_tag_lookup_prefixPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, ffi.Pointer, - ffi.Size)>>('git_tag_lookup_prefix'); + size_t)>>('git_tag_lookup_prefix'); late final _git_tag_lookup_prefix = _git_tag_lookup_prefixPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer, ffi.Pointer, int)>(); @@ -25793,7 +25769,7 @@ class Libgit2 { late final _git_tag_targetPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_tag_target'); late final _git_tag_target = _git_tag_targetPtr.asFunction< int Function( @@ -25840,7 +25816,7 @@ class Libgit2 { /// /// @param tag a previously loaded tag. /// @return name of the tag - ffi.Pointer git_tag_name( + ffi.Pointer git_tag_name( ffi.Pointer tag, ) { return _git_tag_name( @@ -25850,10 +25826,10 @@ class Libgit2 { late final _git_tag_namePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_tag_name'); late final _git_tag_name = _git_tag_namePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Get the tagger (author) of a tag /// @@ -25878,7 +25854,7 @@ class Libgit2 { /// /// @param tag a previously loaded tag. /// @return message of the tag or NULL when unspecified - ffi.Pointer git_tag_message( + ffi.Pointer git_tag_message( ffi.Pointer tag, ) { return _git_tag_message( @@ -25888,10 +25864,10 @@ class Libgit2 { late final _git_tag_messagePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('git_tag_message'); late final _git_tag_message = _git_tag_messagePtr - .asFunction Function(ffi.Pointer)>(); + .asFunction Function(ffi.Pointer)>(); /// Create a new tag in the repository from an object /// @@ -25933,10 +25909,10 @@ class Libgit2 { int git_tag_create( ffi.Pointer oid, ffi.Pointer repo, - ffi.Pointer tag_name, + ffi.Pointer tag_name, ffi.Pointer target, ffi.Pointer tagger, - ffi.Pointer message, + ffi.Pointer message, int force, ) { return _git_tag_create( @@ -25952,22 +25928,22 @@ class Libgit2 { late final _git_tag_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('git_tag_create'); + ffi.Pointer, + ffi.Int32)>>('git_tag_create'); late final _git_tag_create = _git_tag_createPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, int)>(); /// Create a new tag in the object database pointing to a git_object @@ -25994,10 +25970,10 @@ class Libgit2 { int git_tag_annotation_create( ffi.Pointer oid, ffi.Pointer repo, - ffi.Pointer tag_name, + ffi.Pointer tag_name, ffi.Pointer target, ffi.Pointer tagger, - ffi.Pointer message, + ffi.Pointer message, ) { return _git_tag_annotation_create( oid, @@ -26011,22 +25987,22 @@ class Libgit2 { late final _git_tag_annotation_createPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_tag_annotation_create'); + ffi.Pointer)>>('git_tag_annotation_create'); late final _git_tag_annotation_create = _git_tag_annotation_createPtr.asFunction< int Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Create a new tag in the repository from a buffer /// @@ -26038,7 +26014,7 @@ class Libgit2 { int git_tag_create_from_buffer( ffi.Pointer oid, ffi.Pointer repo, - ffi.Pointer buffer, + ffi.Pointer buffer, int force, ) { return _git_tag_create_from_buffer( @@ -26051,12 +26027,12 @@ class Libgit2 { late final _git_tag_create_from_bufferPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int)>>('git_tag_create_from_buffer'); + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Int32)>>('git_tag_create_from_buffer'); late final _git_tag_create_from_buffer = _git_tag_create_from_bufferPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer, int)>(); /// Create a new lightweight tag pointing at a target object /// @@ -26089,7 +26065,7 @@ class Libgit2 { int git_tag_create_lightweight( ffi.Pointer oid, ffi.Pointer repo, - ffi.Pointer tag_name, + ffi.Pointer tag_name, ffi.Pointer target, int force, ) { @@ -26104,16 +26080,16 @@ class Libgit2 { late final _git_tag_create_lightweightPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Int)>>('git_tag_create_lightweight'); + ffi.Int32)>>('git_tag_create_lightweight'); late final _git_tag_create_lightweight = _git_tag_create_lightweightPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer, ffi.Pointer, int)>(); /// Delete an existing tag reference. /// @@ -26128,7 +26104,7 @@ class Libgit2 { /// @return 0 on success, GIT_EINVALIDSPEC or an error code int git_tag_delete( ffi.Pointer repo, - ffi.Pointer tag_name, + ffi.Pointer tag_name, ) { return _git_tag_delete( repo, @@ -26138,10 +26114,10 @@ class Libgit2 { late final _git_tag_deletePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_tag_delete'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_tag_delete'); late final _git_tag_delete = _git_tag_deletePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Fill a list with all the tags in the Repository /// @@ -26166,7 +26142,7 @@ class Libgit2 { late final _git_tag_listPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>('git_tag_list'); late final _git_tag_list = _git_tag_listPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer)>(); @@ -26189,7 +26165,7 @@ class Libgit2 { /// @return 0 or an error code int git_tag_list_match( ffi.Pointer tag_names, - ffi.Pointer pattern, + ffi.Pointer pattern, ffi.Pointer repo, ) { return _git_tag_list_match( @@ -26201,10 +26177,10 @@ class Libgit2 { late final _git_tag_list_matchPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('git_tag_list_match'); late final _git_tag_list_match = _git_tag_list_matchPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); /// Call callback `cb' for each tag in the repository @@ -26226,7 +26202,7 @@ class Libgit2 { late final _git_tag_foreachPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, git_tag_foreach_cb, + ffi.Int32 Function(ffi.Pointer, git_tag_foreach_cb, ffi.Pointer)>>('git_tag_foreach'); late final _git_tag_foreach = _git_tag_foreachPtr.asFunction< int Function(ffi.Pointer, git_tag_foreach_cb, @@ -26252,7 +26228,7 @@ class Libgit2 { late final _git_tag_peelPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_tag_peel'); late final _git_tag_peel = _git_tag_peelPtr.asFunction< int Function( @@ -26276,7 +26252,7 @@ class Libgit2 { late final _git_tag_dupPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_tag_dup'); late final _git_tag_dup = _git_tag_dupPtr.asFunction< int Function(ffi.Pointer>, ffi.Pointer)>(); @@ -26290,8 +26266,8 @@ class Libgit2 { /// @param name a tag name to test /// @return 0 on success or an error code int git_tag_name_is_valid( - ffi.Pointer valid, - ffi.Pointer name, + ffi.Pointer valid, + ffi.Pointer name, ) { return _git_tag_name_is_valid( valid, @@ -26301,10 +26277,10 @@ class Libgit2 { late final _git_tag_name_is_validPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_tag_name_is_valid'); - late final _git_tag_name_is_valid = _git_tag_name_is_validPtr - .asFunction, ffi.Pointer)>(); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_tag_name_is_valid'); + late final _git_tag_name_is_valid = _git_tag_name_is_validPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); /// Create a new transaction object /// @@ -26326,7 +26302,7 @@ class Libgit2 { late final _git_transaction_newPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer)>>('git_transaction_new'); late final _git_transaction_new = _git_transaction_newPtr.asFunction< int Function(ffi.Pointer>, @@ -26342,7 +26318,7 @@ class Libgit2 { /// @return 0 or an error message int git_transaction_lock_ref( ffi.Pointer tx, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_transaction_lock_ref( tx, @@ -26352,11 +26328,11 @@ class Libgit2 { late final _git_transaction_lock_refPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_transaction_lock_ref'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_transaction_lock_ref'); late final _git_transaction_lock_ref = _git_transaction_lock_refPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Set the target of a reference /// @@ -26371,10 +26347,10 @@ class Libgit2 { /// @return 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code int git_transaction_set_target( ffi.Pointer tx, - ffi.Pointer refname, + ffi.Pointer refname, ffi.Pointer target, ffi.Pointer sig, - ffi.Pointer msg, + ffi.Pointer msg, ) { return _git_transaction_set_target( tx, @@ -26387,20 +26363,20 @@ class Libgit2 { late final _git_transaction_set_targetPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_transaction_set_target'); + ffi.Pointer)>>('git_transaction_set_target'); late final _git_transaction_set_target = _git_transaction_set_targetPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Set the target of a reference /// @@ -26415,10 +26391,10 @@ class Libgit2 { /// @return 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code int git_transaction_set_symbolic_target( ffi.Pointer tx, - ffi.Pointer refname, - ffi.Pointer target, + ffi.Pointer refname, + ffi.Pointer target, ffi.Pointer sig, - ffi.Pointer msg, + ffi.Pointer msg, ) { return _git_transaction_set_symbolic_target( tx, @@ -26431,20 +26407,20 @@ class Libgit2 { late final _git_transaction_set_symbolic_targetPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('git_transaction_set_symbolic_target'); + ffi.Pointer)>>('git_transaction_set_symbolic_target'); late final _git_transaction_set_symbolic_target = _git_transaction_set_symbolic_targetPtr.asFunction< int Function( ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer)>(); /// Set the reflog of a reference /// @@ -26457,7 +26433,7 @@ class Libgit2 { /// @return 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code int git_transaction_set_reflog( ffi.Pointer tx, - ffi.Pointer refname, + ffi.Pointer refname, ffi.Pointer reflog, ) { return _git_transaction_set_reflog( @@ -26469,11 +26445,13 @@ class Libgit2 { late final _git_transaction_set_reflogPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function( + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('git_transaction_set_reflog'); late final _git_transaction_set_reflog = _git_transaction_set_reflogPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, + int Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); /// Remove a reference @@ -26483,7 +26461,7 @@ class Libgit2 { /// @return 0, GIT_ENOTFOUND if the reference is not among the locked ones, or an error code int git_transaction_remove( ffi.Pointer tx, - ffi.Pointer refname, + ffi.Pointer refname, ) { return _git_transaction_remove( tx, @@ -26493,10 +26471,10 @@ class Libgit2 { late final _git_transaction_removePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('git_transaction_remove'); + ffi.Int32 Function(ffi.Pointer, + ffi.Pointer)>>('git_transaction_remove'); late final _git_transaction_remove = _git_transaction_removePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + int Function(ffi.Pointer, ffi.Pointer)>(); /// Commit the changes from the transaction /// @@ -26514,7 +26492,7 @@ class Libgit2 { } late final _git_transaction_commitPtr = _lookup< - ffi.NativeFunction)>>( + ffi.NativeFunction)>>( 'git_transaction_commit'); late final _git_transaction_commit = _git_transaction_commitPtr .asFunction)>(); @@ -26542,41 +26520,41 @@ class Libgit2 { class __fsid_t extends ffi.Struct { @ffi.Array.multi([2]) - external ffi.Array __val; + external ffi.Array __val; } class tm extends ffi.Struct { - @ffi.Int() + @ffi.Int32() external int tm_sec; - @ffi.Int() + @ffi.Int32() external int tm_min; - @ffi.Int() + @ffi.Int32() external int tm_hour; - @ffi.Int() + @ffi.Int32() external int tm_mday; - @ffi.Int() + @ffi.Int32() external int tm_mon; - @ffi.Int() + @ffi.Int32() external int tm_year; - @ffi.Int() + @ffi.Int32() external int tm_wday; - @ffi.Int() + @ffi.Int32() external int tm_yday; - @ffi.Int() + @ffi.Int32() external int tm_isdst; - @ffi.Long() + @ffi.Int64() external int tm_gmtoff; - external ffi.Pointer tm_zone; + external ffi.Pointer tm_zone; } class timespec extends ffi.Struct { @@ -26587,8 +26565,8 @@ class timespec extends ffi.Struct { external int tv_nsec; } -typedef __time_t = ffi.Long; -typedef __syscall_slong_t = ffi.Long; +typedef __time_t = ffi.Int64; +typedef __syscall_slong_t = ffi.Int64; class itimerspec extends ffi.Struct { external timespec it_interval; @@ -26602,57 +26580,58 @@ class __locale_struct extends ffi.Struct { @ffi.Array.multi([13]) external ffi.Array> __locales; - external ffi.Pointer __ctype_b; + external ffi.Pointer __ctype_b; - external ffi.Pointer __ctype_tolower; + external ffi.Pointer __ctype_tolower; - external ffi.Pointer __ctype_toupper; + external ffi.Pointer __ctype_toupper; @ffi.Array.multi([13]) - external ffi.Array> __names; + external ffi.Array> __names; } class __locale_data extends ffi.Opaque {} typedef clock_t = __clock_t; -typedef __clock_t = ffi.Long; +typedef __clock_t = ffi.Int64; typedef time_t = __time_t; +typedef size_t = ffi.Uint64; typedef locale_t = __locale_t; typedef __locale_t = ffi.Pointer<__locale_struct>; typedef clockid_t = __clockid_t; -typedef __clockid_t = ffi.Int; +typedef __clockid_t = ffi.Int32; typedef pid_t = __pid_t; -typedef __pid_t = ffi.Int; +typedef __pid_t = ffi.Int32; typedef timer_t = __timer_t; typedef __timer_t = ffi.Pointer; class div_t extends ffi.Struct { - @ffi.Int() + @ffi.Int32() external int quot; - @ffi.Int() + @ffi.Int32() external int rem; } class ldiv_t extends ffi.Struct { - @ffi.Long() + @ffi.Int64() external int quot; - @ffi.Long() + @ffi.Int64() external int rem; } class lldiv_t extends ffi.Struct { - @ffi.LongLong() + @ffi.Int64() external int quot; - @ffi.LongLong() + @ffi.Int64() external int rem; } class __sigset_t extends ffi.Struct { @ffi.Array.multi([16]) - external ffi.Array __val; + external ffi.Array __val; } class timeval extends ffi.Struct { @@ -26663,29 +26642,14 @@ class timeval extends ffi.Struct { external int tv_usec; } -typedef __suseconds_t = ffi.Long; +typedef __suseconds_t = ffi.Int64; class fd_set extends ffi.Struct { @ffi.Array.multi([16]) external ffi.Array<__fd_mask> __fds_bits; } -typedef __fd_mask = ffi.Long; - -class __atomic_wide_counter extends ffi.Union { - @ffi.UnsignedLongLong() - external int __value64; - - external UnnamedStruct1 __value32; -} - -class UnnamedStruct1 extends ffi.Struct { - @ffi.UnsignedInt() - external int __low; - - @ffi.UnsignedInt() - external int __high; -} +typedef __fd_mask = ffi.Int64; class __pthread_internal_list extends ffi.Struct { external ffi.Pointer<__pthread_internal_list> __prev; @@ -26698,25 +26662,25 @@ class __pthread_internal_slist extends ffi.Struct { } class __pthread_mutex_s extends ffi.Struct { - @ffi.Int() + @ffi.Int32() external int __lock; - @ffi.UnsignedInt() + @ffi.Uint32() external int __count; - @ffi.Int() + @ffi.Int32() external int __owner; - @ffi.UnsignedInt() + @ffi.Uint32() external int __nusers; - @ffi.Int() + @ffi.Int32() external int __kind; - @ffi.Short() + @ffi.Int16() external int __spins; - @ffi.Short() + @ffi.Int16() external int __elision; external __pthread_list_t __list; @@ -26725,90 +26689,86 @@ class __pthread_mutex_s extends ffi.Struct { typedef __pthread_list_t = __pthread_internal_list; class __pthread_rwlock_arch_t extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int __readers; - @ffi.UnsignedInt() + @ffi.Uint32() external int __writers; - @ffi.UnsignedInt() + @ffi.Uint32() external int __wrphase_futex; - @ffi.UnsignedInt() + @ffi.Uint32() external int __writers_futex; - @ffi.UnsignedInt() + @ffi.Uint32() external int __pad3; - @ffi.UnsignedInt() + @ffi.Uint32() external int __pad4; - @ffi.Int() + @ffi.Int32() external int __cur_writer; - @ffi.Int() + @ffi.Int32() external int __shared; - @ffi.SignedChar() + @ffi.Int8() external int __rwelision; @ffi.Array.multi([7]) - external ffi.Array __pad1; + external ffi.Array __pad1; - @ffi.UnsignedLong() + @ffi.Uint64() external int __pad2; - @ffi.UnsignedInt() + @ffi.Uint32() external int __flags; } class __pthread_cond_s extends ffi.Struct { - external __atomic_wide_counter __wseq; - - external __atomic_wide_counter __g1_start; + @ffi.Array.multi([2]) + external ffi.Array __g_refs; @ffi.Array.multi([2]) - external ffi.Array __g_refs; + external ffi.Array __g_size; - @ffi.Array.multi([2]) - external ffi.Array __g_size; - - @ffi.UnsignedInt() + @ffi.Uint32() external int __g1_orig_size; - @ffi.UnsignedInt() + @ffi.Uint32() external int __wrefs; @ffi.Array.multi([2]) - external ffi.Array __g_signals; + external ffi.Array __g_signals; } class __once_flag extends ffi.Struct { - @ffi.Int() + @ffi.Int32() external int __data; } class pthread_mutexattr_t extends ffi.Union { @ffi.Array.multi([4]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Int() + @ffi.Int32() external int __align; } class pthread_condattr_t extends ffi.Union { @ffi.Array.multi([4]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Int() + @ffi.Int32() external int __align; } class pthread_attr_t extends ffi.Union { @ffi.Array.multi([56]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Long() + @ffi.Int64() external int __align; } @@ -26816,9 +26776,9 @@ class pthread_mutex_t extends ffi.Union { external __pthread_mutex_s __data; @ffi.Array.multi([40]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Long() + @ffi.Int64() external int __align; } @@ -26826,9 +26786,9 @@ class pthread_cond_t extends ffi.Union { external __pthread_cond_s __data; @ffi.Array.multi([48]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.LongLong() + @ffi.Int64() external int __align; } @@ -26836,33 +26796,33 @@ class pthread_rwlock_t extends ffi.Union { external __pthread_rwlock_arch_t __data; @ffi.Array.multi([56]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Long() + @ffi.Int64() external int __align; } class pthread_rwlockattr_t extends ffi.Union { @ffi.Array.multi([8]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Long() + @ffi.Int64() external int __align; } class pthread_barrier_t extends ffi.Union { @ffi.Array.multi([32]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Long() + @ffi.Int64() external int __align; } class pthread_barrierattr_t extends ffi.Union { @ffi.Array.multi([4]) - external ffi.Array __size; + external ffi.Array __size; - @ffi.Int() + @ffi.Int32() external int __align; } @@ -26873,13 +26833,13 @@ class random_data extends ffi.Struct { external ffi.Pointer state; - @ffi.Int() + @ffi.Int32() external int rand_type; - @ffi.Int() + @ffi.Int32() external int rand_deg; - @ffi.Int() + @ffi.Int32() external int rand_sep; external ffi.Pointer end_ptr; @@ -26887,38 +26847,39 @@ class random_data extends ffi.Struct { class drand48_data extends ffi.Struct { @ffi.Array.multi([3]) - external ffi.Array __x; + external ffi.Array __x; @ffi.Array.multi([3]) - external ffi.Array __old_x; + external ffi.Array __old_x; - @ffi.UnsignedShort() + @ffi.Uint16() external int __c; - @ffi.UnsignedShort() + @ffi.Uint16() external int __init; - @ffi.UnsignedLongLong() + @ffi.Uint64() external int __a; } typedef __compar_fn_t = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>; +typedef wchar_t = ffi.Int32; class imaxdiv_t extends ffi.Struct { - @ffi.Long() + @ffi.Int64() external int quot; - @ffi.Long() + @ffi.Int64() external int rem; } typedef intmax_t = __intmax_t; -typedef __intmax_t = ffi.Long; +typedef __intmax_t = ffi.Int64; typedef uintmax_t = __uintmax_t; -typedef __uintmax_t = ffi.UnsignedLong; -typedef __gwchar_t = ffi.Int; +typedef __uintmax_t = ffi.Uint64; +typedef __gwchar_t = ffi.Int32; /// Combinations of these values describe the features with which libgit2 /// was compiled @@ -27001,22 +26962,22 @@ class git_buf extends ffi.Struct { /// being returned. The buffer's length (in bytes) is specified /// by the `size` member of the structure, and contains a NUL /// terminator at position `(size + 1)`. - external ffi.Pointer ptr; + external ffi.Pointer ptr; /// This field is reserved and unused. - @ffi.Size() + @size_t() external int reserved; /// The length (in bytes) of the buffer pointed to by `ptr`, /// not including a NUL terminator. - @ffi.Size() + @size_t() external int size; } /// Unique identity of any object (commit, tree, blob, tag). class git_oid extends ffi.Struct { @ffi.Array.multi([20]) - external ffi.Array id; + external ffi.Array id; } class git_oid_shorten extends ffi.Opaque {} @@ -27063,7 +27024,7 @@ class git_odb_object extends ffi.Opaque {} class git_odb_stream extends ffi.Struct { external ffi.Pointer backend; - @ffi.UnsignedInt() + @ffi.Uint32() external int mode; external ffi.Pointer hash_ctx; @@ -27075,18 +27036,20 @@ class git_odb_stream extends ffi.Struct { external int received_bytes; external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>> read; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>> write; + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, size_t)>> + read; external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, size_t)>> + write; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>> finalize_write; @@ -27103,15 +27066,15 @@ class git_odb_writepack extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Pointer)>> append; external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>> commit; external ffi.Pointer< @@ -27124,32 +27087,32 @@ class git_odb_writepack extends ffi.Struct { /// fetch or clone that downloads a packfile. class git_indexer_progress extends ffi.Struct { /// number of objects in the packfile being indexed - @ffi.UnsignedInt() + @ffi.Uint32() external int total_objects; /// received objects that have been hashed - @ffi.UnsignedInt() + @ffi.Uint32() external int indexed_objects; /// received_objects: objects which have been downloaded - @ffi.UnsignedInt() + @ffi.Uint32() external int received_objects; /// locally-available objects that have been injected in order /// to fix a thin pack - @ffi.UnsignedInt() + @ffi.Uint32() external int local_objects; /// number of deltas in the packfile being indexed - @ffi.UnsignedInt() + @ffi.Uint32() external int total_deltas; /// received deltas that have been indexed - @ffi.UnsignedInt() + @ffi.Uint32() external int indexed_deltas; /// size of the packfile received up to now - @ffi.Size() + @size_t() external int received_bytes; } @@ -27208,11 +27171,11 @@ class git_time extends ffi.Struct { external int time; /// < timezone offset, in minutes - @ffi.Int() + @ffi.Int32() external int offset; /// < indicator for questionable '-0000' offsets in signature - @ffi.Char() + @ffi.Int8() external int sign; } @@ -27221,10 +27184,10 @@ typedef git_time_t = ffi.Int64; /// An action signature (e.g. for committers, taggers, etc) class git_signature extends ffi.Struct { /// < full name of the author - external ffi.Pointer name; + external ffi.Pointer name; /// < email of the author - external ffi.Pointer email; + external ffi.Pointer email; /// < time when the action happened external git_time when; @@ -27284,18 +27247,18 @@ class git_push extends ffi.Opaque {} /// on `ls` calls. class git_remote_head extends ffi.Struct { /// available locally - @ffi.Int() + @ffi.Int32() external int local; external git_oid oid; external git_oid loid; - external ffi.Pointer name; + external ffi.Pointer name; /// If the server send a symref mapping for this ref, this will /// point to the target. - external ffi.Pointer symref_target; + external ffi.Pointer symref_target; } /// The callback settings structure @@ -27304,7 +27267,7 @@ class git_remote_head extends ffi.Struct { /// about the progress of the network operations. class git_remote_callbacks extends ffi.Struct { /// < The version - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Textual progress from the remote. Text send over the @@ -27314,7 +27277,7 @@ class git_remote_callbacks extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Int32, ffi.Pointer)>> completion; + ffi.Int32 Function(ffi.Int32, ffi.Pointer)>> completion; /// This will be called if the remote host requires /// authentication in order to connect to it. @@ -27336,7 +27299,7 @@ class git_remote_callbacks extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>> update_tips; /// Function to call with progress information during pack @@ -27385,8 +27348,8 @@ class git_remote_callbacks extends ffi.Struct { /// @param payload Payload provided by the caller typedef git_transport_message_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int, ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>>; /// Argument to the completion callback which tells it which operation /// finished. @@ -27418,11 +27381,11 @@ abstract class git_remote_completion_t { /// no credential was acquired typedef git_credential_acquire_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, + ffi.Pointer, + ffi.Pointer, + ffi.Uint32, ffi.Pointer)>>; /// The base structure for all credential types @@ -27491,8 +27454,8 @@ abstract class git_credential_t { /// the existing validity determination should be honored typedef git_transport_certificate_check_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Pointer, - ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Int32, + ffi.Pointer, ffi.Pointer)>>; /// Parent type for `git_cert_hostkey` and `git_cert_x509`. class git_cert extends ffi.Struct { @@ -27529,20 +27492,20 @@ abstract class git_cert_t { /// @param payload Payload provided by caller typedef git_indexer_progress_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>; /// Packbuilder progress notification function typedef git_packbuilder_progress = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Uint32, ffi.Uint32, ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Int32, ffi.Uint32, ffi.Uint32, ffi.Pointer)>>; /// Push network progress notification function typedef git_push_transfer_progress_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.UnsignedInt, ffi.UnsignedInt, ffi.Size, - ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Uint32, ffi.Uint32, size_t, ffi.Pointer)>>; /// Callback used to inform of the update status from the remote. /// @@ -27556,7 +27519,7 @@ typedef git_push_transfer_progress_cb = ffi.Pointer< /// @return 0 on success, otherwise an error typedef git_push_update_reference_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// Callback used to inform of upcoming updates. @@ -27567,16 +27530,16 @@ typedef git_push_update_reference_cb = ffi.Pointer< /// @param payload Payload provided by the caller typedef git_push_negotiation = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, ffi.Size, + ffi.Int32 Function(ffi.Pointer>, size_t, ffi.Pointer)>>; /// Represents an update which will be performed on the remote during push class git_push_update extends ffi.Struct { /// The source name of the reference - external ffi.Pointer src_refname; + external ffi.Pointer src_refname; /// The name of the reference to update on the server - external ffi.Pointer dst_refname; + external ffi.Pointer dst_refname; /// The current target of the reference external git_oid src; @@ -27588,7 +27551,7 @@ class git_push_update extends ffi.Struct { /// Signature of a function which creates a transport typedef git_transport_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, + ffi.Int32 Function(ffi.Pointer>, ffi.Pointer, ffi.Pointer)>>; /// Callback invoked immediately before we attempt to connect to the @@ -27601,8 +27564,8 @@ typedef git_transport_cb = ffi.Pointer< /// @return 0 on success, or an error typedef git_remote_ready_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int, ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Pointer, ffi.Int32, ffi.Pointer)>>; /// Callback to resolve URLs before connecting to remote /// @@ -27617,8 +27580,8 @@ typedef git_remote_ready_cb = ffi.Pointer< /// @deprecated Use `git_remote_set_instance_url` typedef git_url_resolve_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Int32, ffi.Pointer)>>; class git_submodule extends ffi.Opaque {} @@ -27713,12 +27676,14 @@ abstract class git_submodule_recurse_t { /// A type to write in a streaming fashion, for example, for filters. class git_writestream extends ffi.Struct { external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>> write; + ffi.NativeFunction< + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer, size_t)>> + write; external ffi.Pointer< - ffi.NativeFunction)>> close; + ffi.NativeFunction)>> + close; external ffi.Pointer< ffi.NativeFunction)>> free; @@ -27828,7 +27793,7 @@ abstract class git_repository_init_mode_t { /// This contains extra options for `git_repository_init_ext` that enable /// additional initialization features. class git_repository_init_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Combination of GIT_REPOSITORY_INIT flags above. @@ -27845,27 +27810,27 @@ class git_repository_init_options extends ffi.Struct { /// RELATIVE TO THE REPO_PATH. If this is not the "natural" working /// directory, a .git gitlink file will be created here linking to the /// repo_path. - external ffi.Pointer workdir_path; + external ffi.Pointer workdir_path; /// If set, this will be used to initialize the "description" file in the /// repository, instead of using the template content. - external ffi.Pointer description; + external ffi.Pointer description; /// When GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE is set, this contains /// the path to use for the template directory. If this is NULL, the config /// or default directory options will be used instead. - external ffi.Pointer template_path; + external ffi.Pointer template_path; /// The name of the head to point HEAD at. If NULL, then this will be /// treated as "master" and the HEAD ref will be set to "refs/heads/master". /// If this begins with "refs/" it will be used verbatim; /// otherwise "refs/heads/" will be prefixed. - external ffi.Pointer initial_head; + external ffi.Pointer initial_head; /// If this is non-NULL, then after the rest of the repository /// initialization is completed, an "origin" remote will be added /// pointing to this URL. - external ffi.Pointer origin_url; + external ffi.Pointer origin_url; } /// List of items which belong to the git repository layout @@ -27899,8 +27864,8 @@ abstract class git_repository_item_t { /// @return non-zero to terminate the iteration typedef git_repository_fetchhead_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Uint32, ffi.Pointer)>>; /// Callback used to iterate over each MERGE_HEAD entry /// @@ -27911,7 +27876,7 @@ typedef git_repository_fetchhead_foreach_cb = ffi.Pointer< /// @return non-zero to terminate the iteration typedef git_repository_mergehead_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>; /// Repository state /// @@ -27939,7 +27904,8 @@ abstract class git_repository_state_t { /// entry should be removed from the treebuilder list (i.e. filtered out). typedef git_treebuilder_filter_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>; /// Tree traversal modes abstract class git_treewalk_mode { @@ -27953,7 +27919,7 @@ abstract class git_treewalk_mode { /// Callback for the tree traversal method typedef git_treewalk_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// The kind of update to perform @@ -27979,14 +27945,14 @@ class git_tree_update extends ffi.Struct { external int filemode; /// The full path from the root tree - external ffi.Pointer path; + external ffi.Pointer path; } /// Array of strings class git_strarray extends ffi.Struct { - external ffi.Pointer> strings; + external ffi.Pointer> strings; - @ffi.Size() + @size_t() external int count; } @@ -27999,7 +27965,7 @@ class git_strarray extends ffi.Struct { /// @return non-zero to terminate the iteration typedef git_reference_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>; /// Callback used to iterate over reference names /// @@ -28010,7 +27976,7 @@ typedef git_reference_foreach_cb = ffi.Pointer< /// @return non-zero to terminate the iteration typedef git_reference_foreach_name_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>; /// Normalization options for reference lookup abstract class git_reference_format_t { @@ -28250,7 +28216,7 @@ class git_diff_file extends ffi.Struct { /// The NUL-terminated path to the entry relative to the working /// directory of the repository. - external ffi.Pointer path; + external ffi.Pointer path; /// The size of the entry in bytes. @git_object_size_t() @@ -28339,7 +28305,7 @@ class git_diff_delta extends ffi.Struct { /// give the defaults. The default values are marked below. class git_diff_options extends ffi.Struct { /// < version for the struct - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// A combination of `git_diff_option_t` values above. @@ -28389,11 +28355,11 @@ class git_diff_options extends ffi.Struct { /// The virtual "directory" prefix for old file names in hunk headers. /// Default is "a". - external ffi.Pointer old_prefix; + external ffi.Pointer old_prefix; /// The virtual "directory" prefix for new file names in hunk headers. /// Defaults to "b". - external ffi.Pointer new_prefix; + external ffi.Pointer new_prefix; } /// Diff notification callback function. @@ -28409,8 +28375,8 @@ class git_diff_options extends ffi.Struct { /// continues. typedef git_diff_notify_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>; /// Diff progress callback. /// @@ -28422,8 +28388,8 @@ typedef git_diff_notify_cb = ffi.Pointer< /// @return Non-zero to abort the diff. typedef git_diff_progress_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>; /// Note: Can't use off_t since if a client program includes /// before us (directly or indirectly), they'll get 32 bit off_t in their client @@ -28452,14 +28418,14 @@ class git_diff_binary_file extends ffi.Struct { external int type; /// The binary data, deflated. - external ffi.Pointer data; + external ffi.Pointer data; /// The length of the binary data. - @ffi.Size() + @size_t() external int datalen; /// The length of the binary data after inflation. - @ffi.Size() + @size_t() external int inflatedlen; } @@ -28477,7 +28443,7 @@ class git_diff_binary extends ffi.Struct { /// If this is `0` then this was generated knowing only that a binary /// file changed but without providing the data, probably from a patch /// that said `Binary files a/file.txt and b/file.txt differ`. - @ffi.UnsignedInt() + @ffi.Uint32() external int contains_data; /// < The contents of the old file. @@ -28496,27 +28462,27 @@ class git_diff_binary extends ffi.Struct { /// versions in the delta. class git_diff_hunk extends ffi.Struct { /// < Starting line number in old_file - @ffi.Int() + @ffi.Int32() external int old_start; /// < Number of lines in old_file - @ffi.Int() + @ffi.Int32() external int old_lines; /// < Starting line number in new_file - @ffi.Int() + @ffi.Int32() external int new_start; /// < Number of lines in new_file - @ffi.Int() + @ffi.Int32() external int new_lines; /// < Number of bytes in header text - @ffi.Size() + @size_t() external int header_len; @ffi.Array.multi([128]) - external ffi.Array header; + external ffi.Array header; } /// Line origin constants. @@ -28561,23 +28527,23 @@ abstract class git_diff_line_t { /// just a span of bytes inside the larger file. class git_diff_line extends ffi.Struct { /// < A git_diff_line_t value - @ffi.Char() + @ffi.Int8() external int origin; /// < Line number in old file or -1 for added line - @ffi.Int() + @ffi.Int32() external int old_lineno; /// < Line number in new file or -1 for deleted line - @ffi.Int() + @ffi.Int32() external int new_lineno; /// < Number of newline characters in content - @ffi.Int() + @ffi.Int32() external int num_lines; /// < Number of bytes of data - @ffi.Size() + @size_t() external int content_len; /// < Offset in the original file to the content @@ -28585,7 +28551,7 @@ class git_diff_line extends ffi.Struct { external int content_offset; /// < Pointer to diff text, not NUL-byte terminated - external ffi.Pointer content; + external ffi.Pointer content; } /// Flags to control the behavior of diff rename/copy detection. @@ -28664,19 +28630,19 @@ abstract class git_diff_find_t { class git_diff_similarity_metric extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> file_signature; external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Size, + ffi.Pointer, + size_t, ffi.Pointer)>> buffer_signature; external ffi.Pointer< @@ -28686,7 +28652,7 @@ class git_diff_similarity_metric extends ffi.Struct { external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>> similarity; external ffi.Pointer payload; @@ -28696,7 +28662,7 @@ class git_diff_similarity_metric extends ffi.Struct { /// /// These options mostly mimic parameters that can be passed to git-diff. class git_diff_find_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Combination of git_diff_find_t values (default GIT_DIFF_FIND_BY_CONFIG). @@ -28730,7 +28696,7 @@ class git_diff_find_options extends ffi.Struct { /// This is a little different from the `-l` option from Git because we /// will still process up to this many matches before abandoning the search. /// Defaults to 1000. - @ffi.Size() + @size_t() external int rename_limit; /// The `metric` option allows you to plug in a custom similarity metric. @@ -28751,20 +28717,20 @@ class git_diff_find_options extends ffi.Struct { /// @param payload User-specified pointer from foreach function typedef git_diff_file_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Float, ffi.Pointer)>>; /// When iterating over a diff, callback that will be made for /// binary content within the diff. typedef git_diff_binary_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// When iterating over a diff, callback that will be made per hunk. typedef git_diff_hunk_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// When iterating over a diff, callback that will be made per text diff @@ -28775,7 +28741,7 @@ typedef git_diff_hunk_cb = ffi.Pointer< /// of lines of file and hunk headers. typedef git_diff_line_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -28827,7 +28793,7 @@ abstract class git_diff_stats_format_t { /// Initialize with `GIT_PATCHID_OPTIONS_INIT`. Alternatively, you can /// use `git_diff_patchid_options_init`. class git_diff_patchid_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; } @@ -28846,7 +28812,7 @@ abstract class git_apply_flags_t { /// @see git_apply_to_tree, git_apply class git_apply_options extends ffi.Struct { /// < The version - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// When applying a patch, callback that will be made per delta (file). @@ -28859,7 +28825,7 @@ class git_apply_options extends ffi.Struct { external ffi.Pointer payload; /// Bitmask of git_apply_flags_t - @ffi.UnsignedInt() + @ffi.Uint32() external int flags; } @@ -28877,7 +28843,8 @@ class git_apply_options extends ffi.Struct { /// or > 0 if the delta will not be applied. typedef git_apply_delta_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Pointer, ffi.Pointer)>>; /// When applying a patch, callback that will be made per hunk. /// @@ -28893,7 +28860,7 @@ typedef git_apply_delta_cb = ffi.Pointer< /// or > 0 if the hunk will not be applied. typedef git_apply_hunk_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>; /// Possible application locations for git_apply abstract class git_apply_location_t { @@ -28927,11 +28894,11 @@ abstract class git_attr_value_t { /// An options structure for querying attributes. class git_attr_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// A combination of GIT_ATTR_CHECK flags - @ffi.UnsignedInt() + @ffi.Uint32() external int flags; external ffi.Pointer commit_id; @@ -28957,7 +28924,7 @@ class git_attr_options extends ffi.Struct { /// from git_attr_foreach. typedef git_attr_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// Flags to control the functionality of `git_blob_filter`. @@ -28983,7 +28950,7 @@ abstract class git_blob_filter_flag_t { /// Initialize with `GIT_BLOB_FILTER_OPTIONS_INIT`. Alternatively, you can /// use `git_blob_filter_options_init`. class git_blob_filter_options extends ffi.Struct { - @ffi.Int() + @ffi.Int32() external int version; /// Flags to control the filtering process, see `git_blob_filter_flag_t` above @@ -29044,7 +29011,7 @@ abstract class git_blame_flag_t { /// Initialize with `GIT_BLAME_OPTIONS_INIT`. Alternatively, you can /// use `git_blame_options_init`. class git_blame_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// A combination of `git_blame_flag_t` @@ -29070,19 +29037,19 @@ class git_blame_options extends ffi.Struct { /// The first line in the file to blame. /// The default is 1 (line numbers start with 1). - @ffi.Size() + @size_t() external int min_line; /// The last line in the file to blame. /// The default is the last line of the file. - @ffi.Size() + @size_t() external int max_line; } /// Structure that represents a blame hunk. class git_blame_hunk extends ffi.Struct { /// The number of lines in this hunk. - @ffi.Size() + @size_t() external int lines_in_hunk; /// The OID of the commit where this line was last changed. @@ -29090,7 +29057,7 @@ class git_blame_hunk extends ffi.Struct { /// The 1-based line number where this hunk begins, in the final version /// of the file. - @ffi.Size() + @size_t() external int final_start_line_number; /// The author of `final_commit_id`. If `GIT_BLAME_USE_MAILMAP` has been @@ -29104,11 +29071,11 @@ class git_blame_hunk extends ffi.Struct { /// The path to the file where this hunk originated, as of the commit /// specified by `orig_commit_id`. - external ffi.Pointer orig_path; + external ffi.Pointer orig_path; /// The 1-based line number where this hunk begins in the file named by /// `orig_path` in the commit specified by `orig_commit_id`. - @ffi.Size() + @size_t() external int orig_start_line_number; /// The author of `orig_commit_id`. If `GIT_BLAME_USE_MAILMAP` has been @@ -29117,7 +29084,7 @@ class git_blame_hunk extends ffi.Struct { /// The 1 iff the hunk has been tracked to a boundary commit (the root, /// or the commit specified in git_blame_options.oldest_commit) - @ffi.Char() + @ffi.Int8() external int boundary; } @@ -29173,13 +29140,13 @@ class git_cert_hostkey extends ffi.Struct { external int type; @ffi.Array.multi([16]) - external ffi.Array hash_md5; + external ffi.Array hash_md5; @ffi.Array.multi([20]) - external ffi.Array hash_sha1; + external ffi.Array hash_sha1; @ffi.Array.multi([32]) - external ffi.Array hash_sha256; + external ffi.Array hash_sha256; /// Raw hostkey type. If `type` has `GIT_CERT_SSH_RAW` set, this will /// have the type of the raw hostkey. @@ -29188,11 +29155,11 @@ class git_cert_hostkey extends ffi.Struct { /// Pointer to the raw hostkey. If `type` has `GIT_CERT_SSH_RAW` set, /// this will have the raw contents of the hostkey. - external ffi.Pointer hostkey; + external ffi.Pointer hostkey; /// Raw hostkey length. If `type` has `GIT_CERT_SSH_RAW` set, this will /// have the length of the raw contents of the hostkey. - @ffi.Size() + @size_t() external int hostkey_len; } @@ -29205,7 +29172,7 @@ class git_cert_x509 extends ffi.Struct { external ffi.Pointer data; /// Length of the memory block pointed to by `data`. - @ffi.Size() + @size_t() external int len; } @@ -29410,13 +29377,13 @@ abstract class git_checkout_notify_t { /// Checkout performance-reporting structure class git_checkout_perfdata extends ffi.Struct { - @ffi.Size() + @size_t() external int mkdir_calls; - @ffi.Size() + @size_t() external int stat_calls; - @ffi.Size() + @size_t() external int chmod_calls; } @@ -29426,31 +29393,31 @@ class git_checkout_perfdata extends ffi.Struct { /// use `git_checkout_options_init`. class git_checkout_options extends ffi.Struct { /// < The version - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// < default will be a safe checkout - @ffi.UnsignedInt() + @ffi.Uint32() external int checkout_strategy; /// < don't apply filters like CRLF conversion - @ffi.Int() + @ffi.Int32() external int disable_filters; /// < default is 0755 - @ffi.UnsignedInt() + @ffi.Uint32() external int dir_mode; /// < default is 0644 or 0755 as dictated by blob - @ffi.UnsignedInt() + @ffi.Uint32() external int file_mode; /// < default is O_CREAT | O_TRUNC | O_WRONLY - @ffi.Int() + @ffi.Int32() external int file_open_flags; /// < see `git_checkout_notify_t` above - @ffi.UnsignedInt() + @ffi.Uint32() external int notify_flags; /// Optional callback to get notifications on specific file states. @@ -29486,16 +29453,16 @@ class git_checkout_options extends ffi.Struct { external ffi.Pointer baseline_index; /// < alternative checkout path to workdir - external ffi.Pointer target_directory; + external ffi.Pointer target_directory; /// < the name of the common ancestor side of conflicts - external ffi.Pointer ancestor_label; + external ffi.Pointer ancestor_label; /// < the name of the "our" side of conflicts - external ffi.Pointer our_label; + external ffi.Pointer our_label; /// < the name of the "their" side of conflicts - external ffi.Pointer their_label; + external ffi.Pointer their_label; /// Optional callback to notify the consumer of performance data. external git_checkout_perfdata_cb perfdata_cb; @@ -29507,9 +29474,9 @@ class git_checkout_options extends ffi.Struct { /// Checkout notification callback function typedef git_checkout_notify_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Int32, - ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer, @@ -29519,7 +29486,7 @@ typedef git_checkout_notify_cb = ffi.Pointer< typedef git_checkout_progress_cb = ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, ffi.Size, ffi.Size, ffi.Pointer)>>; + ffi.Pointer, size_t, size_t, ffi.Pointer)>>; /// Checkout perfdata notification function typedef git_checkout_perfdata_cb = ffi.Pointer< @@ -29531,7 +29498,7 @@ typedef git_checkout_perfdata_cb = ffi.Pointer< class git_oidarray extends ffi.Struct { external ffi.Pointer ids; - @ffi.Size() + @size_t() external int count; } @@ -29539,7 +29506,7 @@ class git_indexer extends ffi.Opaque {} /// Options for indexer configuration class git_indexer_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// progress_cb function to call with progress information @@ -29549,7 +29516,7 @@ class git_indexer_options extends ffi.Struct { external ffi.Pointer progress_cb_payload; /// Do connectivity checks for the received pack - @ffi.UnsignedChar() + @ffi.Uint8() external int verify; } @@ -29613,7 +29580,7 @@ class git_index_entry extends ffi.Struct { @ffi.Uint16() external int flags_extended; - external ffi.Pointer path; + external ffi.Pointer path; } /// Flags for index entries @@ -29683,28 +29650,28 @@ abstract class git_index_stage_t { /// Callback for APIs that add/remove/update files matching pathspec typedef git_index_matched_path_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// The file inputs to `git_merge_file`. Callers should populate the /// `git_merge_file_input` structure with descriptions of the files in /// each side of the conflict for use in producing the merge file. class git_merge_file_input extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Pointer to the contents of the file. - external ffi.Pointer ptr; + external ffi.Pointer ptr; /// Size of the contents pointed to in `ptr`. - @ffi.Size() + @size_t() external int size; /// File name of the conflicted file, or `NULL` to not merge the path. - external ffi.Pointer path; + external ffi.Pointer path; /// File mode of the conflicted file, or `0` to not merge the mode. - @ffi.UnsignedInt() + @ffi.Uint32() external int mode; } @@ -29803,20 +29770,20 @@ abstract class git_merge_file_flag_t { /// Options for merging a file class git_merge_file_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Label for the ancestor file side of the conflict which will be prepended /// to labels in diff3-format merge files. - external ffi.Pointer ancestor_label; + external ffi.Pointer ancestor_label; /// Label for our file side of the conflict which will be prepended /// to labels in merge files. - external ffi.Pointer our_label; + external ffi.Pointer our_label; /// Label for their file side of the conflict which will be prepended /// to labels in merge files. - external ffi.Pointer their_label; + external ffi.Pointer their_label; /// The file to favor in region conflicts. @ffi.Int32() @@ -29828,7 +29795,7 @@ class git_merge_file_options extends ffi.Struct { /// The size of conflict markers (eg, "<<<<<<<"). Default is /// GIT_MERGE_CONFLICT_MARKER_SIZE. - @ffi.UnsignedShort() + @ffi.Uint16() external int marker_size; } @@ -29836,28 +29803,28 @@ class git_merge_file_options extends ffi.Struct { class git_merge_file_result extends ffi.Struct { /// True if the output was automerged, false if the output contains /// conflict markers. - @ffi.UnsignedInt() + @ffi.Uint32() external int automergeable; /// The path that the resultant merge file should use, or NULL if a /// filename conflict would occur. - external ffi.Pointer path; + external ffi.Pointer path; /// The mode that the resultant merge file should use. - @ffi.UnsignedInt() + @ffi.Uint32() external int mode; /// The contents of the merge. - external ffi.Pointer ptr; + external ffi.Pointer ptr; /// The length of the merge contents. - @ffi.Size() + @size_t() external int len; } /// Merging options class git_merge_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// See `git_merge_flag_t` above @@ -29869,7 +29836,7 @@ class git_merge_options extends ffi.Struct { /// with deleted files to determine their similarity. Files that are /// more similar than the rename threshold (percentage-wise) will be /// treated as a rename. - @ffi.UnsignedInt() + @ffi.Uint32() external int rename_threshold; /// Maximum similarity sources to examine for renames (default 200). @@ -29877,7 +29844,7 @@ class git_merge_options extends ffi.Struct { /// than this value, inexact rename detection is aborted. /// /// This setting overrides the `merge.renameLimit` configuration value. - @ffi.UnsignedInt() + @ffi.Uint32() external int target_limit; /// Pluggable similarity metric; pass NULL to use internal metric @@ -29887,12 +29854,12 @@ class git_merge_options extends ffi.Struct { /// virtual merge base when faced with criss-cross merges. When this /// limit is reached, the next ancestor will simply be used instead of /// attempting to merge it. The default is unlimited. - @ffi.UnsignedInt() + @ffi.Uint32() external int recursion_limit; /// Default merge driver to be used when both sides of a merge have /// changed. The default is the `text` driver. - external ffi.Pointer default_driver; + external ffi.Pointer default_driver; /// Flags for handling conflicting content, to be used with the standard /// (`text`) merge driver. @@ -29945,11 +29912,11 @@ abstract class git_merge_preference_t { /// Cherry-pick options class git_cherrypick_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// For merge commits, the "mainline" is treated as the parent. - @ffi.UnsignedInt() + @ffi.Uint32() external int mainline; /// < Options for the merging @@ -29975,10 +29942,10 @@ class git_credential_userpass_plaintext extends ffi.Struct { external git_credential parent; /// < The username to authenticate as - external ffi.Pointer username; + external ffi.Pointer username; /// < The password to use - external ffi.Pointer password; + external ffi.Pointer password; } /// Username-only credential information @@ -29987,7 +29954,7 @@ class git_credential_username extends ffi.Struct { external git_credential parent; @ffi.Array.multi([1]) - external ffi.Array username; + external ffi.Array username; } /// A ssh key from disk @@ -29996,16 +29963,16 @@ class git_credential_ssh_key extends ffi.Struct { external git_credential parent; /// < The username to authenticate as - external ffi.Pointer username; + external ffi.Pointer username; /// < The path to a public key - external ffi.Pointer publickey; + external ffi.Pointer publickey; /// < The path to a private key - external ffi.Pointer privatekey; + external ffi.Pointer privatekey; /// < Passphrase to decrypt the private key - external ffi.Pointer passphrase; + external ffi.Pointer passphrase; } /// Keyboard-interactive based ssh authentication @@ -30014,7 +29981,7 @@ class git_credential_ssh_interactive extends ffi.Struct { external git_credential parent; /// < The username to authenticate as - external ffi.Pointer username; + external ffi.Pointer username; /// Callback used for authentication. external git_credential_ssh_interactive_cb prompt_callback; @@ -30026,11 +29993,11 @@ class git_credential_ssh_interactive extends ffi.Struct { typedef git_credential_ssh_interactive_cb = ffi.Pointer< ffi.NativeFunction< ffi.Void Function( - ffi.Pointer, - ffi.Int, - ffi.Pointer, - ffi.Int, - ffi.Int, + ffi.Pointer, + ffi.Int32, + ffi.Pointer, + ffi.Int32, + ffi.Int32, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>>; @@ -30048,13 +30015,13 @@ class git_credential_ssh_custom extends ffi.Struct { external git_credential parent; /// < The username to authenticate as - external ffi.Pointer username; + external ffi.Pointer username; /// < The public key data - external ffi.Pointer publickey; + external ffi.Pointer publickey; /// < Length of the public key - @ffi.Size() + @size_t() external int publickey_len; /// Callback used to sign the data. @@ -30066,12 +30033,12 @@ class git_credential_ssh_custom extends ffi.Struct { typedef git_credential_sign_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer, - ffi.Size, + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer, + size_t, ffi.Pointer>)>>; typedef LIBSSH2_SESSION = _LIBSSH2_SESSION; @@ -30093,8 +30060,8 @@ abstract class git_packbuilder_stage_t { /// @return non-zero to terminate the iteration typedef git_packbuilder_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Size, ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Pointer, size_t, ffi.Pointer)>>; /// The type of proxy to use. abstract class git_proxy_t { @@ -30116,7 +30083,7 @@ abstract class git_proxy_t { /// Note that not all types may be supported, depending on the platform /// and compilation options. class git_proxy_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// The type of proxy to use, by URL, auto-detect. @@ -30124,7 +30091,7 @@ class git_proxy_options extends ffi.Struct { external int type; /// The URL of the proxy. - external ffi.Pointer url; + external ffi.Pointer url; /// This will be called if the remote host requires /// authentication in order to connect to it. @@ -30174,7 +30141,7 @@ abstract class git_remote_create_flags { /// Initialize with `GIT_REMOTE_CREATE_OPTIONS_INIT`. Alternatively, you can /// use `git_remote_create_options_init`. class git_remote_create_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// The repository that should own the remote. @@ -30183,13 +30150,13 @@ class git_remote_create_options extends ffi.Struct { /// The remote's name. /// Setting this to NULL results in an in-memory/anonymous remote. - external ffi.Pointer name; + external ffi.Pointer name; /// The fetchspec the remote should use. - external ffi.Pointer fetchspec; + external ffi.Pointer fetchspec; /// Additional flags for the remote. See git_remote_create_flags. - @ffi.UnsignedInt() + @ffi.Uint32() external int flags; } @@ -30230,7 +30197,7 @@ abstract class git_remote_autotag_option_t { /// /// git_fetch_options opts = GIT_FETCH_OPTIONS_INIT; class git_fetch_options extends ffi.Struct { - @ffi.Int() + @ffi.Int32() external int version; /// Callbacks to use for this fetch operation @@ -30242,7 +30209,7 @@ class git_fetch_options extends ffi.Struct { /// Whether to write the results to FETCH_HEAD. Defaults to /// on. Leave this default in order to behave like git. - @ffi.Int() + @ffi.Int32() external int update_fetchhead; /// Determines how to behave regarding tags on the remote, such @@ -30268,7 +30235,7 @@ class git_fetch_options extends ffi.Struct { /// Controls the behavior of a git_push object. class git_push_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// If the transport being used to push to the remote requires the creation @@ -30277,7 +30244,7 @@ class git_push_options extends ffi.Struct { /// /// If set to 0, the packbuilder will auto-detect the number of threads /// to create. The default value is 1. - @ffi.UnsignedInt() + @ffi.Uint32() external int pb_parallelism; /// Callbacks to use for this push operation @@ -30301,7 +30268,7 @@ class git_push_options extends ffi.Struct { /// Initialize with `GIT_REMOTE_CREATE_OPTIONS_INIT`. Alternatively, you can /// use `git_remote_create_options_init`. class git_remote_connect_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Callbacks to use for this connection @@ -30346,7 +30313,7 @@ abstract class git_clone_local_t { /// Initialize with `GIT_CLONE_OPTIONS_INIT`. Alternatively, you can /// use `git_clone_options_init`. class git_clone_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// These options are passed to the checkout step. To disable @@ -30362,7 +30329,7 @@ class git_clone_options extends ffi.Struct { /// Set to zero (false) to create a standard repo, or non-zero /// for a bare repo - @ffi.Int() + @ffi.Int32() external int bare; /// Whether to use a fetch or copy the object database. @@ -30371,7 +30338,7 @@ class git_clone_options extends ffi.Struct { /// The name of the branch to checkout. NULL means use the /// remote's default branch. - external ffi.Pointer checkout_branch; + external ffi.Pointer checkout_branch; /// A callback used to create the new repository into which to /// clone. If NULL, the 'bare' field will be used to determine @@ -30407,8 +30374,8 @@ class git_clone_options extends ffi.Struct { /// @return 0, or a negative value to indicate error typedef git_repository_create_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, ffi.Int, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer>, + ffi.Pointer, ffi.Int32, ffi.Pointer)>>; /// The signature of a function matching git_remote_create, with an additional /// void* as a callback payload. @@ -30424,11 +30391,11 @@ typedef git_repository_create_cb = ffi.Pointer< /// @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code typedef git_remote_create_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer>, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>; /// Priority level of a config file. @@ -30466,13 +30433,13 @@ abstract class git_config_level_t { /// An entry in a configuration file class git_config_entry extends ffi.Struct { /// < Name of the entry (normalised) - external ffi.Pointer name; + external ffi.Pointer name; /// < String value of the entry - external ffi.Pointer value; + external ffi.Pointer value; /// < Depth of includes where this variable was found - @ffi.UnsignedInt() + @ffi.Uint32() external int include_depth; /// < Which config file this was found in @@ -30502,9 +30469,9 @@ class git_configmap extends ffi.Struct { @ffi.Int32() external int type; - external ffi.Pointer str_match; + external ffi.Pointer str_match; - @ffi.Int() + @ffi.Int32() external int map_value; } @@ -30515,7 +30482,7 @@ class git_configmap extends ffi.Struct { /// @return non-zero to terminate the iteration. typedef git_config_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer)>>; /// Reference lookup strategy @@ -30534,29 +30501,29 @@ abstract class git_describe_strategy_t { /// Initialize with `GIT_DESCRIBE_OPTIONS_INIT`. Alternatively, you can /// use `git_describe_options_init`. class git_describe_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// < default: 10 - @ffi.UnsignedInt() + @ffi.Uint32() external int max_candidates_tags; /// < default: GIT_DESCRIBE_DEFAULT - @ffi.UnsignedInt() + @ffi.Uint32() external int describe_strategy; - external ffi.Pointer pattern; + external ffi.Pointer pattern; /// When calculating the distance from the matching tag or /// reference, only walk down the first-parent ancestry. - @ffi.Int() + @ffi.Int32() external int only_follow_first_parent; /// If no matching tag or reference is found, the describe /// operation would normally fail. If this option is set, it /// will instead fall back to showing the full id of the /// commit. - @ffi.Int() + @ffi.Int32() external int show_commit_oid_as_fallback; } @@ -30565,22 +30532,22 @@ class git_describe_options extends ffi.Struct { /// Initialize with `GIT_DESCRIBE_FORMAT_OPTIONS_INIT`. Alternatively, you can /// use `git_describe_format_options_init`. class git_describe_format_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Size of the abbreviated commit id to use. This value is the /// lower bound for the length of the abbreviated string. The /// default is 7. - @ffi.UnsignedInt() + @ffi.Uint32() external int abbreviated_size; /// Set to use the long format even when a shorter name could be used. - @ffi.Int() + @ffi.Int32() external int always_use_long_format; /// If the workdir is dirty and this is set, this string will /// be appended to the description string. - external ffi.Pointer dirty_suffix; + external ffi.Pointer dirty_suffix; } class git_describe_result extends ffi.Opaque {} @@ -30688,9 +30655,9 @@ abstract class git_error_code { /// This is kept on a per-thread basis if GIT_THREADS was defined when the /// library was build, otherwise one is kept globally for the library class git_error extends ffi.Struct { - external ffi.Pointer message; + external ffi.Pointer message; - @ffi.Int() + @ffi.Int32() external int klass; } @@ -30729,7 +30696,7 @@ abstract class git_error_t { static const int GIT_ERROR_FILESYSTEM = 30; static const int GIT_ERROR_PATCH = 31; static const int GIT_ERROR_WORKTREE = 32; - static const int GIT_ERROR_SHA = 33; + static const int GIT_ERROR_SHA1 = 33; static const int GIT_ERROR_HTTP = 34; static const int GIT_ERROR_INTERNAL = 35; } @@ -30766,7 +30733,7 @@ abstract class git_filter_flag_t { /// Filtering options class git_filter_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// See `git_filter_flag_t` above @@ -30788,7 +30755,7 @@ class git_filter_list extends ffi.Opaque {} /// /// Use to tell the rebase machinery how to operate. class git_rebase_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// Used by `git_rebase_init`, this will instruct other clients working @@ -30796,7 +30763,7 @@ class git_rebase_options extends ffi.Struct { /// may choose to provide in an application-specific manner. This has no /// effect upon libgit2 directly, but is provided for interoperability /// between Git tools. - @ffi.Int() + @ffi.Int32() external int quiet; /// Used by `git_rebase_init`, this will begin an in-memory rebase, @@ -30804,7 +30771,7 @@ class git_rebase_options extends ffi.Struct { /// commit the rebased changes, but will not rewind HEAD or update the /// repository to be in a rebasing state. This will not interfere with /// the working directory (if there is one). - @ffi.Int() + @ffi.Int32() external int inmemory; /// Used by `git_rebase_finish`, this is the name of the notes reference @@ -30813,7 +30780,7 @@ class git_rebase_options extends ffi.Struct { /// is examined, unless the configuration option `notes.rewrite.rebase` /// is set to false. If `notes.rewriteRef` is also NULL, notes will /// not be rewritten. - external ffi.Pointer rewrite_notes_ref; + external ffi.Pointer rewrite_notes_ref; /// Options to control how trees are merged during `git_rebase_next`. external git_merge_options merge_options; @@ -30850,8 +30817,8 @@ class git_rebase_options extends ffi.Struct { /// commit buffer, signs it, and commits it. external ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> signing_cb; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>> signing_cb; /// This will be passed to each of the callbacks in this struct /// as the last parameter. @@ -30884,14 +30851,14 @@ class git_rebase_options extends ffi.Struct { /// and return a failure typedef git_commit_create_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( + ffi.Int32 Function( ffi.Pointer, ffi.Pointer, ffi.Pointer, - ffi.Pointer, - ffi.Pointer, + ffi.Pointer, + ffi.Pointer, ffi.Pointer, - ffi.Size, + size_t, ffi.Pointer>, ffi.Pointer)>>; @@ -30937,7 +30904,7 @@ class git_rebase_operation extends ffi.Struct { /// The executable the user has requested be run. This will only /// be populated for operations of type `GIT_REBASE_OPERATION_EXEC`. - external ffi.Pointer exec; + external ffi.Pointer exec; } /// Available tracing levels. When tracing is set to a particular level, @@ -30967,15 +30934,15 @@ abstract class git_trace_level_t { /// An instance for a tracing function typedef git_trace_cb = ffi.Pointer< - ffi.NativeFunction)>>; + ffi.NativeFunction)>>; /// Options for revert class git_revert_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// For merge commits, the "mainline" is treated as the parent. - @ffi.UnsignedInt() + @ffi.Uint32() external int mainline; /// < Options for the merging @@ -31007,7 +30974,7 @@ class git_revspec extends ffi.Struct { external ffi.Pointer to; /// The intent of the revspec (i.e. `git_revspec_mode_t` flags) - @ffi.UnsignedInt() + @ffi.Uint32() external int flags; } @@ -31069,7 +31036,7 @@ abstract class git_stash_apply_progress_t { /// Initialize with `GIT_STASH_APPLY_OPTIONS_INIT`. Alternatively, you can /// use `git_stash_apply_options_init`. class git_stash_apply_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// See `git_stash_apply_flags`, above. @@ -31089,7 +31056,7 @@ class git_stash_apply_options extends ffi.Struct { /// Return 0 to continue processing, or a negative value to /// abort the stash application. typedef git_stash_apply_progress_cb = ffi.Pointer< - ffi.NativeFunction)>>; + ffi.NativeFunction)>>; /// This is a callback function you can provide to iterate over all the /// stashed states that will be invoked per entry. @@ -31102,7 +31069,7 @@ typedef git_stash_apply_progress_cb = ffi.Pointer< /// @return 0 to continue iterating or non-zero to stop. typedef git_stash_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Size, ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(size_t, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// Status flags for a single file. @@ -31238,20 +31205,17 @@ abstract class git_status_opt_t { /// use `git_status_options_init`. class git_status_options extends ffi.Struct { /// The struct version; pass `GIT_STATUS_OPTIONS_VERSION`. - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// The `show` value is one of the `git_status_show_t` constants that - /// control which files to scan and in what order. The default is - /// `GIT_STATUS_SHOW_INDEX_AND_WORKDIR`. + /// control which files to scan and in what order. @ffi.Int32() external int show1; /// The `flags` value is an OR'ed combination of the - /// `git_status_opt_t` values above. The default is - /// `GIT_STATUS_OPT_DEFAULTS`, which matches git's default - /// behavior. - @ffi.UnsignedInt() + /// `git_status_opt_t` values above. + @ffi.Uint32() external int flags; /// The `pathspec` is an array of path patterns to match (using @@ -31300,8 +31264,8 @@ class git_status_entry extends ffi.Struct { /// `payload` is the value you passed to the foreach function as payload. typedef git_status_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.UnsignedInt, ffi.Pointer)>>; + ffi.Int32 Function( + ffi.Pointer, ffi.Uint32, ffi.Pointer)>>; /// Return codes for submodule status. /// @@ -31365,7 +31329,7 @@ abstract class git_submodule_status_t { /// Initialize with `GIT_SUBMODULE_UPDATE_OPTIONS_INIT`. Alternatively, you can /// use `git_submodule_update_options_init`. class git_submodule_update_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// These options are passed to the checkout step. To disable @@ -31383,7 +31347,7 @@ class git_submodule_update_options extends ffi.Struct { /// Allow fetching from the submodule's default remote if the target /// commit isn't found. Enabled by default. - @ffi.Int() + @ffi.Int32() external int allow_fetch; } @@ -31395,7 +31359,7 @@ class git_submodule_update_options extends ffi.Struct { /// @return 0 on success or error code typedef git_submodule_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// Worktree add options structure @@ -31403,11 +31367,11 @@ typedef git_submodule_cb = ffi.Pointer< /// Initialize with `GIT_WORKTREE_ADD_OPTIONS_INIT`. Alternatively, you can /// use `git_worktree_add_options_init`. class git_worktree_add_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// < lock newly created worktree - @ffi.Int() + @ffi.Int32() external int lock; /// < reference to use for the new worktree HEAD @@ -31435,7 +31399,7 @@ abstract class git_worktree_prune_t { /// Initialize with `GIT_WORKTREE_PRUNE_OPTIONS_INIT`. Alternatively, you can /// use `git_worktree_prune_options_init`. class git_worktree_prune_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// A combination of `git_worktree_prune_t` @@ -31445,9 +31409,9 @@ class git_worktree_prune_options extends ffi.Struct { /// Payload for git_credential_userpass_plaintext. class git_credential_userpass_payload extends ffi.Struct { - external ffi.Pointer username; + external ffi.Pointer username; - external ffi.Pointer password; + external ffi.Pointer password; } /// Formatting options for diff e-mail generation @@ -31461,7 +31425,7 @@ abstract class git_diff_format_email_flags_t { /// Options for controlling the formatting of the generated e-mail. class git_diff_format_email_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// see `git_diff_format_email_flags_t` above @@ -31469,21 +31433,21 @@ class git_diff_format_email_options extends ffi.Struct { external int flags; /// This patch number - @ffi.Size() + @size_t() external int patch_no; /// Total number of patches in this series - @ffi.Size() + @size_t() external int total_patches; /// id to use for the commit external ffi.Pointer id; /// Summary of the change - external ffi.Pointer summary; + external ffi.Pointer summary; /// Commit message's body - external ffi.Pointer body; + external ffi.Pointer body; /// Author of the change external ffi.Pointer author; @@ -31507,7 +31471,7 @@ abstract class git_email_create_flags_t { /// Options for controlling the formatting of the generated e-mail. class git_email_create_options extends ffi.Struct { - @ffi.UnsignedInt() + @ffi.Uint32() external int version; /// see `git_email_create_flags_t` above @@ -31524,23 +31488,23 @@ class git_email_create_options extends ffi.Struct { /// string ("") then only the patch numbers will be shown in the /// prefix. If the subject_prefix is empty and patch numbers /// are not being shown, the prefix will be omitted entirely. - external ffi.Pointer subject_prefix; + external ffi.Pointer subject_prefix; /// The starting patch number; this cannot be 0. By default, /// this is 1. - @ffi.Size() + @size_t() external int start_number; /// The "re-roll" number. By default, there is no re-roll. - @ffi.Size() + @size_t() external int reroll_number; } /// Represents a single git message trailer. class git_message_trailer extends ffi.Struct { - external ffi.Pointer key; + external ffi.Pointer key; - external ffi.Pointer value; + external ffi.Pointer value; } /// Represents an array of git message trailers. @@ -31550,11 +31514,11 @@ class git_message_trailer extends ffi.Struct { class git_message_trailer_array extends ffi.Struct { external ffi.Pointer trailers; - @ffi.Size() + @size_t() external int count; /// private - external ffi.Pointer _trailer_block; + external ffi.Pointer _trailer_block; } class git_iterator extends ffi.Opaque {} @@ -31570,7 +31534,7 @@ typedef git_note_iterator = git_iterator; /// - payload: Payload data passed to `git_note_foreach` typedef git_note_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; /// Flags controlling the behavior of ODB lookup operations @@ -31590,7 +31554,7 @@ class git_odb_expand_id extends ffi.Struct { /// The length of the object ID (in nibbles, or packets of 4 bits; the /// number of hex characters) - @ffi.UnsignedShort() + @ffi.Uint16() external int length; /// The (optional) type of the object to search for; leave as `0` or set @@ -31602,7 +31566,7 @@ class git_odb_expand_id extends ffi.Struct { /// Function type for callbacks from git_odb_foreach. typedef git_odb_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>; /// Streaming mode abstract class git_odb_stream_t { @@ -31694,7 +31658,7 @@ abstract class git_sort_t { /// @return non-zero to hide the commmit and it parent. typedef git_revwalk_hide_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>; + ffi.Int32 Function(ffi.Pointer, ffi.Pointer)>>; /// Callback used to iterate over tag names /// @@ -31706,7 +31670,7 @@ typedef git_revwalk_hide_cb = ffi.Pointer< /// @return non-zero to terminate the iteration typedef git_tag_foreach_cb = ffi.Pointer< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>>; const int _TIME_H = 1; @@ -31763,19 +31727,15 @@ const int _STDC_PREDEF_H = 1; const int __STDC_IEC_559__ = 1; -const int __STDC_IEC_60559_BFP__ = 201404; - const int __STDC_IEC_559_COMPLEX__ = 1; -const int __STDC_IEC_60559_COMPLEX__ = 201404; - const int __STDC_ISO_10646__ = 201706; const int __GNU_LIBRARY__ = 6; const int __GLIBC__ = 2; -const int __GLIBC_MINOR__ = 35; +const int __GLIBC_MINOR__ = 34; const int _SYS_CDEFS_H = 1; @@ -32651,8 +32611,6 @@ const int GITERR_WORKTREE = 32; const int GITERR_SHA1 = 33; -const int GIT_ERROR_SHA1 = 33; - const int GIT_IDXENTRY_NAMEMASK = 4095; const int GIT_IDXENTRY_STAGEMASK = 12288; @@ -32757,16 +32715,14 @@ const int GIT_CREDTYPE_SSH_MEMORY = 64; const int GIT_EMAIL_CREATE_OPTIONS_VERSION = 1; -const String LIBGIT2_VERSION = '1.5.0'; +const String LIBGIT2_VERSION = '1.4.3'; const int LIBGIT2_VER_MAJOR = 1; -const int LIBGIT2_VER_MINOR = 5; +const int LIBGIT2_VER_MINOR = 4; -const int LIBGIT2_VER_REVISION = 0; +const int LIBGIT2_VER_REVISION = 3; const int LIBGIT2_VER_PATCH = 0; -const int LIBGIT2_VER_PRERELEASE = 0; - -const String LIBGIT2_SOVERSION = '1.5'; +const String LIBGIT2_SOVERSION = '1.4'; diff --git a/lib/src/bindings/libgit2_opts_bindings.dart b/lib/src/bindings/libgit2_opts_bindings.dart deleted file mode 100644 index 0c1df6c..0000000 --- a/lib/src/bindings/libgit2_opts_bindings.dart +++ /dev/null @@ -1,468 +0,0 @@ -// coverage:ignore-file - -import 'dart:ffi' as ffi; -import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; - -/// Bindings to libgit2 global options -class Libgit2Opts { - /// Holds the symbol lookup function. - final ffi.Pointer Function(String symbolName) - _lookup; - - /// The symbols are looked up in [dynamicLibrary]. - Libgit2Opts(ffi.DynamicLibrary dynamicLibrary) - : _lookup = dynamicLibrary.lookup; - - /// Get the maximum mmap window size. - int git_libgit2_opts_get_mwindow_size(ffi.Pointer out) { - return _git_libgit2_opts_get_int( - git_libgit2_opt_t.GIT_OPT_GET_MWINDOW_SIZE, - out, - ); - } - - /// Set the maximum mmap window size. - int git_libgit2_opts_set_mwindow_size(int value) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_SET_MWINDOW_SIZE, - value, - ); - } - - /// Get the maximum memory that will be mapped in total by the library. - /// - /// The default (0) is unlimited. - int git_libgit2_opts_get_mwindow_mapped_limit(ffi.Pointer out) { - return _git_libgit2_opts_get_int( - git_libgit2_opt_t.GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, - out, - ); - } - - /// Set the maximum amount of memory that can be mapped at any time by the - /// library. - int git_libgit2_opts_set_mwindow_mapped_limit(int value) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, - value, - ); - } - - /// Get the maximum number of files that will be mapped at any time by the - /// library. - /// - /// The default (0) is unlimited. - int git_libgit2_opts_get_mwindow_file_limit(ffi.Pointer out) { - return _git_libgit2_opts_get_int( - git_libgit2_opt_t.GIT_OPT_GET_MWINDOW_FILE_LIMIT, - out, - ); - } - - /// Set the maximum number of files that can be mapped at any time by the - /// library. - int git_libgit2_opts_set_mwindow_file_limit(int value) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_SET_MWINDOW_FILE_LIMIT, - value, - ); - } - - /// Get the search path for a given level of config data. - /// - /// [level] must be one of `GIT_CONFIG_LEVEL_SYSTEM`, - /// `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or - /// `GIT_CONFIG_LEVEL_PROGRAMDATA`. - /// - /// The search path is written to the [out] buffer. - int git_libgit2_opts_get_search_path(int level, ffi.Pointer out) { - return _git_libgit2_opts_get_search_path( - git_libgit2_opt_t.GIT_OPT_GET_SEARCH_PATH, - level, - out, - ); - } - - /// Set the search path for a level of config data. The search path applied - /// to shared attributes and ignore files, too. - /// - /// [path] lists directories delimited by GIT_PATH_LIST_SEPARATOR. - /// Pass NULL to reset to the default (generally based on environment - /// variables). Use magic path `$PATH` to include the old value of the path - /// (if you want to prepend or append, for instance). - /// - /// [level] must be one of `GIT_CONFIG_LEVEL_SYSTEM`, - /// `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or - /// `GIT_CONFIG_LEVEL_PROGRAMDATA`. - int git_libgit2_opts_set_search_path(int level, ffi.Pointer path) { - return _git_libgit2_opts_set_search_path( - git_libgit2_opt_t.GIT_OPT_SET_SEARCH_PATH, - level, - path, - ); - } - - /// Set the maximum data size for the given [type] of object to be - /// considered eligible for caching in memory. Setting the [value] to - /// zero means that that type of object will not be cached. - /// - /// Defaults to 0 for GIT_OBJECT_BLOB (i.e. won't cache blobs) and 4k - /// for GIT_OBJECT_COMMIT, GIT_OBJECT_TREE, and GIT_OBJECT_TAG. - int git_libgit2_opts_set_cache_object_limit(int type, int value) { - return _git_libgit2_opts_set_cache_object_limit( - git_libgit2_opt_t.GIT_OPT_SET_CACHE_OBJECT_LIMIT, - type, - value, - ); - } - - /// Set the maximum total data size that will be cached in memory - /// across all repositories before libgit2 starts evicting objects - /// from the cache. This is a soft limit, in that the library might - /// briefly exceed it, but will start aggressively evicting objects - /// from cache when that happens. - /// - /// The default cache size is 256MB. - int git_libgit2_opts_set_cache_max_size(int bytes) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_SET_CACHE_MAX_SIZE, - bytes, - ); - } - - /// Get the current bytes in cache and the maximum that would be - /// allowed in the cache. - int git_libgit2_opts_get_cached_memory( - ffi.Pointer current, - ffi.Pointer allowed, - ) { - return _git_libgit2_opts_get_cached_memory( - git_libgit2_opt_t.GIT_OPT_GET_CACHED_MEMORY, - current, - allowed, - ); - } - - /// Enable or disable caching completely. - /// - /// Because caches are repository-specific, disabling the cache - /// cannot immediately clear all cached objects, but each cache will - /// be cleared on the next attempt to update anything in it. - int git_libgit2_opts_enable_caching(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_CACHING, - enabled, - ); - } - - /// Get the default template path. - /// The path is written to the `out` buffer. - int git_libgit2_opts_get_template_path(ffi.Pointer out) { - return _git_libgit2_opts_get_buf( - git_libgit2_opt_t.GIT_OPT_GET_TEMPLATE_PATH, - out, - ); - } - - /// Set the default template [path]. - int git_libgit2_opts_set_template_path(ffi.Pointer path) { - return _git_libgit2_opts_set_char( - git_libgit2_opt_t.GIT_OPT_SET_TEMPLATE_PATH, - path, - ); - } - - /// Set the SSL certificate-authority locations. - /// - /// - [file] is the location of a file containing several - /// certificates concatenated together. - /// - [path] is the location of a directory holding several - /// certificates, one per file. - /// - /// Either parameter may be `NULL`, but not both. - int git_libgit2_opts_set_ssl_cert_locations( - ffi.Pointer file, - ffi.Pointer path, - ) { - return _git_libgit2_opts_set_ssl_cert_locations( - git_libgit2_opt_t.GIT_OPT_SET_SSL_CERT_LOCATIONS, - file, - path, - ); - } - - /// Get the value of the User-Agent header. - /// - /// The User-Agent is written to the `out` buffer. - int git_libgit2_opts_get_user_agent(ffi.Pointer out) { - return _git_libgit2_opts_get_buf( - git_libgit2_opt_t.GIT_OPT_GET_USER_AGENT, - out, - ); - } - - /// Set the value of the User-Agent header. This value will be - /// appended to "git/1.0", for compatibility with other git clients. - /// - /// - [user_agent] is the value that will be delivered as the - /// User-Agent header on HTTP requests. - int git_libgit2_opts_set_user_agent(ffi.Pointer user_agent) { - return _git_libgit2_opts_set_char( - git_libgit2_opt_t.GIT_OPT_SET_USER_AGENT, - user_agent, - ); - } - - /// Enable strict input validation when creating new objects - /// to ensure that all inputs to the new objects are valid. - /// - /// For example, when this is enabled, the parent(s) and tree inputs - /// will be validated when creating a new commit. - /// - /// This defaults to enabled. - int git_libgit2_opts_enable_strict_object_creation(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, - enabled, - ); - } - - /// Validate the target of a symbolic ref when creating it. - /// - /// For example, `foobar` is not a valid ref, therefore `foobar` is - /// not a valid target for a symbolic ref by default, whereas - /// `refs/heads/foobar` is. - /// - /// Disabling this bypasses validation so that an arbitrary strings - /// such as `foobar` can be used for a symbolic ref target. - /// - /// This defaults to enabled. - int git_libgit2_opts_enable_strict_symbolic_ref_creation(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION, - enabled, - ); - } - - /// Enable or disable the use of "offset deltas" when creating packfiles, - /// and the negotiation of them when talking to a remote server. - /// - /// Offset deltas store a delta base location as an offset into the - /// packfile from the current location, which provides a shorter encoding - /// and thus smaller resultant packfiles. - /// - /// Packfiles containing offset deltas can still be read. - /// - /// This defaults to enabled. - int git_libgit2_opts_enable_offset_delta(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_OFS_DELTA, - enabled, - ); - } - - /// Enable synchronized writes of files in the gitdir using `fsync` - /// (or the platform equivalent) to ensure that new object data - /// is written to permanent storage, not simply cached. - /// - /// This defaults to disabled. - int git_libgit2_opts_enable_fsync_gitdir(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_FSYNC_GITDIR, - enabled, - ); - } - - /// Enable strict verification of object hashsums when reading - /// objects from disk. - /// - /// This may impact performance due to an additional checksum calculation - /// on each object. - /// - /// This defaults to enabled. - int git_libgit2_opts_enable_strict_hash_verification(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, - enabled, - ); - } - - /// Ensure that there are no unsaved changes in the index before - /// beginning any operation that reloads the index from disk (e.g., - /// checkout). - /// - /// If there are unsaved changes, the instruction will fail (using - /// the FORCE flag to checkout will still overwrite these changes). - int git_libgit2_opts_enable_unsaved_index_safety(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY, - enabled, - ); - } - - /// Get the maximum number of objects libgit2 will allow in a pack - /// file when downloading a pack file from a remote. This can be - /// used to limit maximum memory usage when fetching from an untrusted - /// remote. - int git_libgit2_opts_get_pack_max_objects(ffi.Pointer out) { - return _git_libgit2_opts_get_int( - git_libgit2_opt_t.GIT_OPT_GET_PACK_MAX_OBJECTS, - out, - ); - } - - /// Set the maximum number of objects libgit2 will allow in a pack - /// file when downloading a pack file from a remote. - int git_libgit2_opts_set_pack_max_objects(int value) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_SET_PACK_MAX_OBJECTS, - value, - ); - } - - /// This will cause .keep file existence checks to be skipped when - /// accessing packfiles, which can help performance with remote filesystems. - int git_libgit2_opts_disable_pack_keep_file_checks(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS, - enabled, - ); - } - - /// When connecting to a server using NTLM or Negotiate - /// authentication, use expect/continue when POSTing data. - /// - /// This option is not available on Windows. - int git_libgit2_opts_enable_http_expect_continue(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE, - enabled, - ); - } - - /// Gets the owner validation setting for repository directories. - int git_libgit2_opts_get_owner_validation(ffi.Pointer out) { - return _git_libgit2_opts_get_int( - git_libgit2_opt_t.GIT_OPT_GET_OWNER_VALIDATION, - out, - ); - } - - /// Set that repository directories should be owned by the current - /// user. The default is to validate ownership. - int git_libgit2_opts_set_owner_validation(int enabled) { - return _git_libgit2_opts_set_int( - git_libgit2_opt_t.GIT_OPT_SET_OWNER_VALIDATION, - enabled, - ); - } - - /// Returns the list of git extensions that are supported. - /// This is the list of built-in extensions supported by libgit2 and - /// custom extensions that have been added with [git_libgit2_opts_set_extensions]. - /// - /// Extensions that have been negated will not be returned. - int git_libgit2_opts_get_extensions(ffi.Pointer out) { - return _git_libgit2_opts_get_extensions( - git_libgit2_opt_t.GIT_OPT_GET_EXTENSIONS, - out, - ); - } - - /// Set that the given git extensions are supported by the caller. - /// - /// Extensions supported by libgit2 may be negated by prefixing - /// them with a `!`. For example: setting extensions to - /// { "!noop", "newext" } indicates that the caller does not want - /// to support repositories with the `noop` extension but does want - /// to support repositories with the `newext` extension. - int git_libgit2_opts_set_extensions( - ffi.Pointer> extensions, - int len, - ) { - return _git_libgit2_opts_set_extensions( - git_libgit2_opt_t.GIT_OPT_SET_EXTENSIONS, - extensions, - len, - ); - } - - late final _git_libgit2_opts_get_intPtr = _lookup< - ffi.NativeFunction)>>( - 'git_libgit2_opts'); - late final _git_libgit2_opts_get_int = _git_libgit2_opts_get_intPtr - .asFunction)>(); - - late final _git_libgit2_opts_set_intPtr = - _lookup>( - 'git_libgit2_opts'); - late final _git_libgit2_opts_set_int = - _git_libgit2_opts_set_intPtr.asFunction(); - - late final _git_libgit2_opts_get_bufPtr = _lookup< - ffi.NativeFunction)>>( - 'git_libgit2_opts'); - late final _git_libgit2_opts_get_buf = _git_libgit2_opts_get_bufPtr - .asFunction)>(); - - late final _git_libgit2_opts_set_charPtr = _lookup< - ffi.NativeFunction)>>( - 'git_libgit2_opts'); - late final _git_libgit2_opts_set_char = _git_libgit2_opts_set_charPtr - .asFunction)>(); - - late final _git_libgit2_opts_get_search_pathPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Int, ffi.Pointer)>>('git_libgit2_opts'); - late final _git_libgit2_opts_get_search_path = - _git_libgit2_opts_get_search_pathPtr - .asFunction)>(); - - late final _git_libgit2_opts_set_search_pathPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Int, ffi.Pointer)>>('git_libgit2_opts'); - late final _git_libgit2_opts_set_search_path = - _git_libgit2_opts_set_search_pathPtr - .asFunction)>(); - - late final _git_libgit2_opts_set_cache_object_limitPtr = - _lookup>( - 'git_libgit2_opts'); - late final _git_libgit2_opts_set_cache_object_limit = - _git_libgit2_opts_set_cache_object_limitPtr - .asFunction(); - - late final _git_libgit2_opts_get_cached_memoryPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, - ffi.Pointer)>>('git_libgit2_opts'); - late final _git_libgit2_opts_get_cached_memory = - _git_libgit2_opts_get_cached_memoryPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer)>(); - - late final _git_libgit2_opts_set_ssl_cert_locationsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, - ffi.Pointer)>>('git_libgit2_opts'); - late final _git_libgit2_opts_set_ssl_cert_locations = - _git_libgit2_opts_set_ssl_cert_locationsPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer)>(); - - late final _git_libgit2_opts_get_extensionsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer)>>('git_libgit2_opts'); - late final _git_libgit2_opts_get_extensions = - _git_libgit2_opts_get_extensionsPtr - .asFunction)>(); - - late final _git_libgit2_opts_set_extensionsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer>, - ffi.Int)>>('git_libgit2_opts'); - late final _git_libgit2_opts_set_extensions = - _git_libgit2_opts_set_extensionsPtr.asFunction< - int Function(int, ffi.Pointer>, int)>(); -} diff --git a/lib/src/bindings/mailmap.dart b/lib/src/bindings/mailmap.dart index 142acfd..c4e69c5 100644 --- a/lib/src/bindings/mailmap.dart +++ b/lib/src/bindings/mailmap.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Allocate a new mailmap object. The returned mailmap must be freed with @@ -26,7 +25,7 @@ Pointer init() { /// returned mailmap must be freed with [free]. Pointer fromBuffer(String buffer) { final out = calloc>(); - final bufferC = buffer.toChar(); + final bufferC = buffer.toNativeUtf8().cast(); libgit2.git_mailmap_from_buffer(out, bufferC, buffer.length); @@ -71,10 +70,10 @@ List resolve({ required String name, required String email, }) { - final outRealName = calloc>(); - final outRealEmail = calloc>(); - final nameC = name.toChar(); - final emailC = email.toChar(); + final outRealName = calloc>(); + final outRealEmail = calloc>(); + final nameC = name.toNativeUtf8().cast(); + final emailC = email.toNativeUtf8().cast(); libgit2.git_mailmap_resolve( outRealName, outRealEmail, @@ -83,8 +82,8 @@ List resolve({ emailC, ); - final realName = outRealName.value.toDartString(); - final realEmail = outRealEmail.value.toDartString(); + final realName = outRealName.value.cast().toDartString(); + final realEmail = outRealEmail.value.cast().toDartString(); calloc.free(outRealName); calloc.free(outRealEmail); calloc.free(nameC); @@ -120,10 +119,10 @@ void addEntry({ String? replaceName, required String replaceEmail, }) { - final realNameC = realName?.toChar() ?? nullptr; - final realEmailC = realEmail?.toChar() ?? nullptr; - final replaceNameC = replaceName?.toChar() ?? nullptr; - final replaceEmailC = replaceEmail.toChar(); + final realNameC = realName?.toNativeUtf8().cast() ?? nullptr; + final realEmailC = realEmail?.toNativeUtf8().cast() ?? nullptr; + final replaceNameC = replaceName?.toNativeUtf8().cast() ?? nullptr; + final replaceEmailC = replaceEmail.toNativeUtf8().cast(); libgit2.git_mailmap_add_entry( mailmapPointer, diff --git a/lib/src/bindings/merge.dart b/lib/src/bindings/merge.dart index 2e16d11..5c92ed3 100644 --- a/lib/src/bindings/merge.dart +++ b/lib/src/bindings/merge.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Find a merge base between two commits. @@ -184,44 +183,35 @@ String mergeFile({ libgit2.git_merge_file_input_init(ancestorC, GIT_MERGE_FILE_INPUT_VERSION); libgit2.git_merge_file_input_init(oursC, GIT_MERGE_FILE_INPUT_VERSION); libgit2.git_merge_file_input_init(theirsC, GIT_MERGE_FILE_INPUT_VERSION); - ancestorC.ref.ptr = ancestor.toChar(); + ancestorC.ref.ptr = ancestor.toNativeUtf8().cast(); ancestorC.ref.size = ancestor.length; - Pointer ancestorLabelC = nullptr; - oursC.ref.ptr = ours.toChar(); + oursC.ref.ptr = ours.toNativeUtf8().cast(); oursC.ref.size = ours.length; - Pointer oursLabelC = nullptr; - theirsC.ref.ptr = theirs.toChar(); + theirsC.ref.ptr = theirs.toNativeUtf8().cast(); theirsC.ref.size = theirs.length; - Pointer theirsLabelC = nullptr; final opts = calloc(); libgit2.git_merge_file_options_init(opts, GIT_MERGE_FILE_OPTIONS_VERSION); opts.ref.favor = favor; opts.ref.flags = flags; if (ancestorLabel.isNotEmpty) { - ancestorLabelC = ancestorLabel.toChar(); - opts.ref.ancestor_label = ancestorLabelC; + opts.ref.ancestor_label = ancestorLabel.toNativeUtf8().cast(); } if (oursLabel.isNotEmpty) { - oursLabelC = oursLabel.toChar(); - opts.ref.our_label = oursLabelC; + opts.ref.our_label = oursLabel.toNativeUtf8().cast(); } if (theirsLabel.isNotEmpty) { - theirsLabelC = theirsLabel.toChar(); - opts.ref.their_label = theirsLabelC; + opts.ref.their_label = theirsLabel.toNativeUtf8().cast(); } libgit2.git_merge_file(out, ancestorC, oursC, theirsC, opts); calloc.free(ancestorC); - calloc.free(ancestorLabelC); calloc.free(oursC); - calloc.free(oursLabelC); calloc.free(theirsC); - calloc.free(theirsLabelC); calloc.free(opts); - final result = out.ref.ptr.toDartString(length: out.ref.len); + final result = out.ref.ptr.cast().toDartString(length: out.ref.len); calloc.free(out); return result; @@ -235,54 +225,24 @@ String mergeFile({ String mergeFileFromIndex({ required Pointer repoPointer, required Pointer? ancestorPointer, - required String ancestorLabel, required Pointer oursPointer, - required String oursLabel, required Pointer theirsPointer, - required String theirsLabel, - required int favor, - required int flags, }) { final out = calloc(); - final opts = calloc(); - Pointer ancestorLabelC = nullptr; - Pointer oursLabelC = nullptr; - Pointer theirsLabelC = nullptr; - - libgit2.git_merge_file_options_init(opts, GIT_MERGE_FILE_OPTIONS_VERSION); - opts.ref.favor = favor; - opts.ref.flags = flags; - if (ancestorLabel.isNotEmpty) { - ancestorLabelC = ancestorLabel.toChar(); - opts.ref.ancestor_label = ancestorLabelC; - } - if (oursLabel.isNotEmpty) { - oursLabelC = oursLabel.toChar(); - opts.ref.our_label = oursLabelC; - } - if (theirsLabel.isNotEmpty) { - theirsLabelC = theirsLabel.toChar(); - opts.ref.their_label = theirsLabelC; - } - final error = libgit2.git_merge_file_from_index( out, repoPointer, ancestorPointer ?? nullptr, oursPointer, theirsPointer, - opts, + nullptr, ); late final String result; if (out.ref.ptr != nullptr) { - result = out.ref.ptr.toDartString(length: out.ref.len); + result = out.ref.ptr.cast().toDartString(length: out.ref.len); } - calloc.free(ancestorLabelC); - calloc.free(oursLabelC); - calloc.free(theirsLabelC); - calloc.free(opts); calloc.free(out); if (error < 0) { diff --git a/lib/src/bindings/note.dart b/lib/src/bindings/note.dart index bf7f58a..2dd69f8 100644 --- a/lib/src/bindings/note.dart +++ b/lib/src/bindings/note.dart @@ -3,24 +3,16 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Returns list of notes for repository. The returned notes must be freed with /// [free]. /// /// Throws a [LibGit2Error] if error occured. -List> list({ - required Pointer repoPointer, - required String notesRef, -}) { - final notesRefC = notesRef.toChar(); +List> list(Pointer repo) { + final notesRef = 'refs/notes/commits'.toNativeUtf8().cast(); final iterator = calloc>(); - final iteratorError = libgit2.git_note_iterator_new( - iterator, - repoPointer, - notesRefC, - ); + final iteratorError = libgit2.git_note_iterator_new(iterator, repo, notesRef); if (iteratorError < 0) { calloc.free(iterator); @@ -36,7 +28,7 @@ List> list({ nextError = libgit2.git_note_next(noteOid, annotatedOid, iterator.value); if (nextError >= 0) { final out = calloc>(); - libgit2.git_note_read(out, repoPointer, notesRefC, annotatedOid); + libgit2.git_note_read(out, repo, notesRef, annotatedOid); final note = out.value; @@ -49,7 +41,7 @@ List> list({ calloc.free(noteOid); } - calloc.free(notesRefC); + calloc.free(notesRef); libgit2.git_note_iterator_free(iterator.value); calloc.free(iterator); @@ -62,10 +54,10 @@ List> list({ Pointer lookup({ required Pointer repoPointer, required Pointer oidPointer, - required String notesRef, + String notesRef = 'refs/notes/commits', }) { final out = calloc>(); - final notesRefC = notesRef.toChar(); + final notesRefC = notesRef.toNativeUtf8().cast(); final error = libgit2.git_note_read(out, repoPointer, notesRefC, oidPointer); final result = out.value; @@ -93,8 +85,8 @@ Pointer create({ bool force = false, }) { final out = calloc(); - final notesRefC = notesRef.toChar(); - final noteC = note.toChar(); + final notesRefC = notesRef.toNativeUtf8().cast(); + final noteC = note.toNativeUtf8().cast(); final forceC = force ? 1 : 0; final error = libgit2.git_note_create( out, @@ -128,7 +120,7 @@ void delete({ required Pointer committerPointer, required Pointer oidPointer, }) { - final notesRefC = notesRef.toChar(); + final notesRefC = notesRef.toNativeUtf8().cast(); final error = libgit2.git_note_remove( repoPointer, @@ -150,7 +142,7 @@ Pointer id(Pointer note) => libgit2.git_note_id(note); /// Get the note message. String message(Pointer note) { - return libgit2.git_note_message(note).toDartString(); + return libgit2.git_note_message(note).cast().toDartString(); } /// Free memory allocated for note object. diff --git a/lib/src/bindings/odb.dart b/lib/src/bindings/odb.dart index 33aa62f..afab156 100644 --- a/lib/src/bindings/odb.dart +++ b/lib/src/bindings/odb.dart @@ -4,7 +4,6 @@ import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/oid.dart' as oid_bindings; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/oid.dart'; import 'package:libgit2dart/src/util.dart'; @@ -37,7 +36,7 @@ void addDiskAlternate({ required Pointer odbPointer, required String path, }) { - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); libgit2.git_odb_add_disk_alternate(odbPointer, pathC); calloc.free(pathC); } @@ -95,7 +94,7 @@ int _forEachCb( List objects(Pointer odb) { const except = -1; final cb = - Pointer.fromFunction, Pointer)>( + Pointer.fromFunction, Pointer)>( _forEachCb, except, ); @@ -185,7 +184,7 @@ Pointer write({ throw LibGit2Error(libgit2.git_error_last()); } - final bufferC = data.toChar(); + final bufferC = data.toNativeUtf8().cast(); libgit2.git_odb_stream_write(stream.value, bufferC, data.length); final out = calloc(); diff --git a/lib/src/bindings/oid.dart b/lib/src/bindings/oid.dart index 2b061e5..c95b49d 100644 --- a/lib/src/bindings/oid.dart +++ b/lib/src/bindings/oid.dart @@ -2,13 +2,12 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Parse N characters of a hex formatted object id into a git_oid. Pointer fromStrN(String hex) { final out = calloc(); - final hexC = hex.toChar(); + final hexC = hex.toNativeUtf8().cast(); libgit2.git_oid_fromstrn(out, hexC, hex.length); calloc.free(hexC); @@ -19,7 +18,7 @@ Pointer fromStrN(String hex) { /// Parse a hex formatted object id into a git_oid. Pointer fromSHA(String hex) { final out = calloc(); - final hexC = hex.toChar(); + final hexC = hex.toNativeUtf8().cast(); libgit2.git_oid_fromstr(out, hexC); calloc.free(hexC); @@ -28,9 +27,9 @@ Pointer fromSHA(String hex) { } /// Copy an already raw oid into a git_oid structure. -Pointer fromRaw(Array raw) { +Pointer fromRaw(Array raw) { final out = calloc(); - final rawC = calloc(20); + final rawC = calloc(20); for (var i = 0; i < 20; i++) { rawC[i] = raw[i]; @@ -45,10 +44,10 @@ Pointer fromRaw(Array raw) { /// Format a git_oid into a hex string. String toSHA(Pointer id) { - final out = calloc(40); + final out = calloc(40); libgit2.git_oid_fmt(out, id); - final result = out.toDartString(length: 40); + final result = out.cast().toDartString(length: 40); calloc.free(out); return result; } diff --git a/lib/src/bindings/packbuilder.dart b/lib/src/bindings/packbuilder.dart index 9d5aae1..7eca208 100644 --- a/lib/src/bindings/packbuilder.dart +++ b/lib/src/bindings/packbuilder.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Initialize a new packbuilder. The returned packbuilder must be freed with @@ -122,7 +121,7 @@ void write({ required Pointer packbuilderPointer, String? path, }) { - final pathC = path?.toChar() ?? nullptr; + final pathC = path?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_packbuilder_write( packbuilderPointer, pathC, @@ -154,7 +153,7 @@ int writtenCount(Pointer pb) { /// correct after the packfile has been written. String name(Pointer pb) { final result = libgit2.git_packbuilder_name(pb); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Set number of threads to spawn. diff --git a/lib/src/bindings/patch.dart b/lib/src/bindings/patch.dart index 5815ed4..6914941 100644 --- a/lib/src/bindings/patch.dart +++ b/lib/src/bindings/patch.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Directly generate a patch from the difference between two buffers. The @@ -18,11 +17,11 @@ Pointer fromBuffers({ required int interhunkLines, }) { final out = calloc>(); - final oldBufferC = oldBuffer?.toChar() ?? nullptr; - final oldAsPathC = oldAsPath?.toChar() ?? nullptr; + final oldBufferC = oldBuffer?.toNativeUtf8().cast() ?? nullptr; + final oldAsPathC = oldAsPath?.toNativeUtf8().cast() ?? nullptr; final oldLen = oldBuffer?.length ?? 0; - final newBufferC = newBuffer?.toChar() ?? nullptr; - final newAsPathC = oldAsPath?.toChar() ?? nullptr; + final newBufferC = newBuffer?.toNativeUtf8().cast() ?? nullptr; + final newAsPathC = oldAsPath?.toNativeUtf8().cast() ?? nullptr; final newLen = newBuffer?.length ?? 0; final opts = _diffOptionsInit( flags: flags, @@ -66,8 +65,8 @@ Pointer fromBlobs({ required int interhunkLines, }) { final out = calloc>(); - final oldAsPathC = oldAsPath?.toChar() ?? nullptr; - final newAsPathC = oldAsPath?.toChar() ?? nullptr; + final oldAsPathC = oldAsPath?.toNativeUtf8().cast() ?? nullptr; + final newAsPathC = oldAsPath?.toNativeUtf8().cast() ?? nullptr; final opts = _diffOptionsInit( flags: flags, contextLines: contextLines, @@ -105,9 +104,9 @@ Pointer fromBlobAndBuffer({ required int interhunkLines, }) { final out = calloc>(); - final oldAsPathC = oldAsPath?.toChar() ?? nullptr; - final bufferC = buffer?.toChar() ?? nullptr; - final bufferAsPathC = oldAsPath?.toChar() ?? nullptr; + final oldAsPathC = oldAsPath?.toNativeUtf8().cast() ?? nullptr; + final bufferC = buffer?.toNativeUtf8().cast() ?? nullptr; + final bufferAsPathC = oldAsPath?.toNativeUtf8().cast() ?? nullptr; final bufferLen = buffer?.length ?? 0; final opts = _diffOptionsInit( flags: flags, @@ -176,8 +175,8 @@ Map hunk({ required int hunkIndex, }) { final out = calloc>(); - final linesInHunk = calloc(); - libgit2.git_patch_get_hunk(out, linesInHunk, patchPointer, hunkIndex); + final linesInHunk = calloc(); + libgit2.git_patch_get_hunk(out, linesInHunk.cast(), patchPointer, hunkIndex); final hunk = out.value; final linesN = linesInHunk.value; @@ -190,9 +189,9 @@ Map hunk({ /// Get line counts of each type in a patch. Map lineStats(Pointer patch) { - final context = calloc(); - final insertions = calloc(); - final deletions = calloc(); + final context = calloc(); + final insertions = calloc(); + final deletions = calloc(); libgit2.git_patch_line_stats( context, insertions, @@ -236,7 +235,7 @@ String text(Pointer patch) { final out = calloc(); final error = libgit2.git_patch_to_buf(out, patch); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); diff --git a/lib/src/bindings/rebase.dart b/lib/src/bindings/rebase.dart index 71e8d09..3c32345 100644 --- a/lib/src/bindings/rebase.dart +++ b/lib/src/bindings/rebase.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Initializes a rebase operation to rebase the changes in [branchPointer] @@ -129,7 +128,7 @@ void commit({ required String? message, }) { final out = calloc(); - final messageC = message?.toChar() ?? nullptr; + final messageC = message?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_rebase_commit( out, @@ -164,7 +163,7 @@ Pointer origHeadOid(Pointer rebase) => /// Gets the original HEAD ref name for merge rebases. String origHeadName(Pointer rebase) { final result = libgit2.git_rebase_orig_head_name(rebase); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Gets the onto id for merge rebases. @@ -173,7 +172,7 @@ Pointer ontoOid(Pointer rebase) => /// Gets the onto ref name for merge rebases. String ontoName(Pointer rebase) { - return libgit2.git_rebase_onto_name(rebase).toDartString(); + return libgit2.git_rebase_onto_name(rebase).cast().toDartString(); } /// Free memory allocated for rebase object. diff --git a/lib/src/bindings/reference.dart b/lib/src/bindings/reference.dart index 81e190c..2fc23ab 100644 --- a/lib/src/bindings/reference.dart +++ b/lib/src/bindings/reference.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Get the type of a reference. @@ -56,7 +55,7 @@ Pointer lookup({ required String name, }) { final out = calloc>(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final error = libgit2.git_reference_lookup(out, repoPointer, nameC); final result = out.value; @@ -73,7 +72,7 @@ Pointer lookup({ /// Get the full name of a reference. String name(Pointer ref) { - return libgit2.git_reference_name(ref).toDartString(); + return libgit2.git_reference_name(ref).cast().toDartString(); } /// Get the reference's short name. @@ -81,7 +80,7 @@ String name(Pointer ref) { /// This will transform the reference name into a name "human-readable" version. /// If no shortname is appropriate, it will return the full name. String shorthand(Pointer ref) { - return libgit2.git_reference_shorthand(ref).toDartString(); + return libgit2.git_reference_shorthand(ref).cast().toDartString(); } /// Rename an existing reference. The returned reference must be freed with @@ -105,9 +104,9 @@ Pointer rename({ String? logMessage, }) { final out = calloc>(); - final newNameC = newName.toChar(); + final newNameC = newName.toNativeUtf8().cast(); final forceC = force == true ? 1 : 0; - final logMessageC = logMessage?.toChar() ?? nullptr; + final logMessageC = logMessage?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_reference_rename( out, refPointer, @@ -141,7 +140,9 @@ List list(Pointer repo) { throw LibGit2Error(libgit2.git_error_last()); } else { for (var i = 0; i < array.ref.count; i++) { - result.add(array.ref.strings.elementAt(i).value.toDartString()); + result.add( + array.ref.strings.elementAt(i).value.cast().toDartString(), + ); } } @@ -155,7 +156,7 @@ bool hasLog({ required Pointer repoPointer, required String name, }) { - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final result = libgit2.git_reference_has_log(repoPointer, nameC); calloc.free(nameC); @@ -172,7 +173,7 @@ void ensureLog({ required Pointer repoPointer, required String refName, }) { - final refNameC = refName.toChar(); + final refNameC = refName.toNativeUtf8().cast(); final error = libgit2.git_reference_ensure_log(repoPointer, refNameC); calloc.free(refNameC); @@ -236,9 +237,9 @@ Pointer createDirect({ String? logMessage, }) { final out = calloc>(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final forceC = force == true ? 1 : 0; - final logMessageC = logMessage?.toChar() ?? nullptr; + final logMessageC = logMessage?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_reference_create( out, repoPointer, @@ -294,10 +295,10 @@ Pointer createSymbolic({ String? logMessage, }) { final out = calloc>(); - final nameC = name.toChar(); - final targetC = target.toChar(); + final nameC = name.toNativeUtf8().cast(); + final targetC = target.toNativeUtf8().cast(); final forceC = force == true ? 1 : 0; - final logMessageC = logMessage?.toChar() ?? nullptr; + final logMessageC = logMessage?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_reference_symbolic_create( out, repoPointer, @@ -347,7 +348,7 @@ Pointer setTarget({ String? logMessage, }) { final out = calloc>(); - final logMessageC = logMessage?.toChar() ?? nullptr; + final logMessageC = logMessage?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_reference_set_target( out, refPointer, @@ -387,8 +388,8 @@ Pointer setTargetSymbolic({ String? logMessage, }) { final out = calloc>(); - final targetC = target.toChar(); - final logMessageC = logMessage?.toChar() ?? nullptr; + final targetC = target.toNativeUtf8().cast(); + final logMessageC = logMessage?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_reference_symbolic_set_target( out, refPointer, @@ -409,6 +410,14 @@ Pointer setTargetSymbolic({ } } +/// Compare two references. +bool compare({ + required Pointer ref1Pointer, + required Pointer ref2Pointer, +}) { + return libgit2.git_reference_cmp(ref1Pointer, ref2Pointer) == 0 || false; +} + /// Recursively peel reference until object of the specified type is found. /// /// The retrieved peeled object is owned by the repository and should be closed diff --git a/lib/src/bindings/reflog.dart b/lib/src/bindings/reflog.dart index ff982f2..428e66f 100644 --- a/lib/src/bindings/reflog.dart +++ b/lib/src/bindings/reflog.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Read the reflog for the given reference. The returned reflog must be @@ -16,7 +15,7 @@ Pointer read({ required String name, }) { final out = calloc>(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); libgit2.git_reflog_read(out, repoPointer, nameC); final result = out.value; @@ -44,7 +43,7 @@ void delete({ required Pointer repoPointer, required String name, }) { - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); libgit2.git_reflog_delete(repoPointer, nameC); calloc.free(nameC); } @@ -61,8 +60,8 @@ void rename({ required String oldName, required String newName, }) { - final oldNameC = oldName.toChar(); - final newNameC = newName.toChar(); + final oldNameC = oldName.toNativeUtf8().cast(); + final newNameC = newName.toNativeUtf8().cast(); final error = libgit2.git_reflog_rename(repoPointer, oldNameC, newNameC); calloc.free(oldNameC); @@ -82,7 +81,8 @@ void add({ required Pointer committerPointer, required String message, }) { - final messageC = message.isEmpty ? nullptr : message.toChar(); + final messageC = + message.isEmpty ? nullptr : message.toNativeUtf8().cast(); final error = libgit2.git_reflog_append( reflogPointer, @@ -130,7 +130,7 @@ Pointer getByIndex({ /// Get the log message. String entryMessage(Pointer entry) { final result = libgit2.git_reflog_entry_message(entry); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Get the committer of this entry. The returned signature must be freed. diff --git a/lib/src/bindings/refspec.dart b/lib/src/bindings/refspec.dart index c42ffa2..a7a484a 100644 --- a/lib/src/bindings/refspec.dart +++ b/lib/src/bindings/refspec.dart @@ -3,17 +3,16 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Get the source specifier. String source(Pointer refspec) { - return libgit2.git_refspec_src(refspec).toDartString(); + return libgit2.git_refspec_src(refspec).cast().toDartString(); } /// Get the destination specifier. String destination(Pointer refspec) { - return libgit2.git_refspec_dst(refspec).toDartString(); + return libgit2.git_refspec_dst(refspec).cast().toDartString(); } /// Get the force update setting. @@ -23,7 +22,7 @@ bool force(Pointer refspec) { /// Get the refspec's string. String string(Pointer refspec) { - return libgit2.git_refspec_string(refspec).toDartString(); + return libgit2.git_refspec_string(refspec).cast().toDartString(); } /// Get the refspec's direction. @@ -35,7 +34,7 @@ bool matchesSource({ required Pointer refspecPointer, required String refname, }) { - final refnameC = refname.toChar(); + final refnameC = refname.toNativeUtf8().cast(); final result = libgit2.git_refspec_src_matches(refspecPointer, refnameC); calloc.free(refnameC); @@ -48,7 +47,7 @@ bool matchesDestination({ required Pointer refspecPointer, required String refname, }) { - final refnameC = refname.toChar(); + final refnameC = refname.toNativeUtf8().cast(); final result = libgit2.git_refspec_dst_matches(refspecPointer, refnameC); calloc.free(refnameC); @@ -64,10 +63,10 @@ String transform({ required String name, }) { final out = calloc(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final error = libgit2.git_refspec_transform(out, refspecPointer, nameC); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -89,10 +88,10 @@ String rTransform({ required String name, }) { final out = calloc(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final error = libgit2.git_refspec_rtransform(out, refspecPointer, nameC); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); diff --git a/lib/src/bindings/remote.dart b/lib/src/bindings/remote.dart index 6c68426..338cbf7 100644 --- a/lib/src/bindings/remote.dart +++ b/lib/src/bindings/remote.dart @@ -5,7 +5,6 @@ import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/remote_callbacks.dart'; import 'package:libgit2dart/src/callbacks.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/oid.dart'; import 'package:libgit2dart/src/util.dart'; @@ -14,9 +13,10 @@ List list(Pointer repo) { final out = calloc(); libgit2.git_remote_list(out, repo); - final result = [ - for (var i = 0; i < out.ref.count; i++) out.ref.strings[i].toDartString() - ]; + final result = []; + for (var i = 0; i < out.ref.count; i++) { + result.add(out.ref.strings[i].cast().toDartString()); + } calloc.free(out); @@ -34,7 +34,7 @@ Pointer lookup({ required String name, }) { final out = calloc>(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final error = libgit2.git_remote_lookup(out, repoPointer, nameC); final result = out.value; @@ -59,8 +59,8 @@ Pointer create({ required String url, }) { final out = calloc>(); - final nameC = name.toChar(); - final urlC = url.toChar(); + final nameC = name.toNativeUtf8().cast(); + final urlC = url.toNativeUtf8().cast(); final error = libgit2.git_remote_create(out, repoPointer, nameC, urlC); final result = out.value; @@ -87,9 +87,9 @@ Pointer createWithFetchSpec({ required String fetch, }) { final out = calloc>(); - final nameC = name.toChar(); - final urlC = url.toChar(); - final fetchC = fetch.toChar(); + final nameC = name.toNativeUtf8().cast(); + final urlC = url.toNativeUtf8().cast(); + final fetchC = fetch.toNativeUtf8().cast(); final error = libgit2.git_remote_create_with_fetchspec( out, repoPointer, @@ -122,7 +122,7 @@ void delete({ required Pointer repoPointer, required String name, }) { - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final error = libgit2.git_remote_delete(repoPointer, nameC); calloc.free(nameC); @@ -151,8 +151,8 @@ List rename({ required String newName, }) { final out = calloc(); - final nameC = name.toChar(); - final newNameC = newName.toChar(); + final nameC = name.toNativeUtf8().cast(); + final newNameC = newName.toNativeUtf8().cast(); final error = libgit2.git_remote_rename(out, repoPointer, nameC, newNameC); calloc.free(nameC); @@ -162,12 +162,11 @@ List rename({ calloc.free(out); throw LibGit2Error(libgit2.git_error_last()); } else { - final result = [ - for (var i = 0; i < out.ref.count; i++) out.ref.strings[i].toDartString() - ]; - + final result = []; + for (var i = 0; i < out.ref.count; i++) { + result.add(out.ref.strings[i].cast().toDartString()); + } calloc.free(out); - return result; } } @@ -183,8 +182,8 @@ void setUrl({ required String remote, required String url, }) { - final remoteC = remote.toChar(); - final urlC = url.toChar(); + final remoteC = remote.toNativeUtf8().cast(); + final urlC = url.toNativeUtf8().cast(); final error = libgit2.git_remote_set_url(repoPointer, remoteC, urlC); calloc.free(remoteC); @@ -206,8 +205,8 @@ void setPushUrl({ required String remote, required String url, }) { - final remoteC = remote.toChar(); - final urlC = url.toChar(); + final remoteC = remote.toNativeUtf8().cast(); + final urlC = url.toNativeUtf8().cast(); final error = libgit2.git_remote_set_pushurl(repoPointer, remoteC, urlC); calloc.free(remoteC); @@ -221,12 +220,12 @@ void setPushUrl({ /// Get the remote's name. String name(Pointer remote) { final result = libgit2.git_remote_name(remote); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Get the remote's url. String url(Pointer remote) { - return libgit2.git_remote_url(remote).toDartString(); + return libgit2.git_remote_url(remote).cast().toDartString(); } /// Get the remote's url for pushing. @@ -234,7 +233,7 @@ String url(Pointer remote) { /// Returns empty string if no special url for pushing is set. String pushUrl(Pointer remote) { final result = libgit2.git_remote_pushurl(remote); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Get the number of refspecs for a remote. @@ -254,12 +253,11 @@ List fetchRefspecs(Pointer remote) { final out = calloc(); libgit2.git_remote_get_fetch_refspecs(out, remote); - final result = [ - for (var i = 0; i < out.ref.count; i++) out.ref.strings[i].toDartString() - ]; - + final result = []; + for (var i = 0; i < out.ref.count; i++) { + result.add(out.ref.strings[i].cast().toDartString()); + } calloc.free(out); - return result; } @@ -268,12 +266,11 @@ List pushRefspecs(Pointer remote) { final out = calloc(); libgit2.git_remote_get_push_refspecs(out, remote); - final result = [ - for (var i = 0; i < out.ref.count; i++) out.ref.strings[i].toDartString() - ]; - + final result = []; + for (var i = 0; i < out.ref.count; i++) { + result.add(out.ref.strings[i].cast().toDartString()); + } calloc.free(out); - return result; } @@ -288,8 +285,8 @@ void addFetch({ required String remote, required String refspec, }) { - final remoteC = remote.toChar(); - final refspecC = refspec.toChar(); + final remoteC = remote.toNativeUtf8().cast(); + final refspecC = refspec.toNativeUtf8().cast(); final error = libgit2.git_remote_add_fetch(repoPointer, remoteC, refspecC); calloc.free(remoteC); @@ -311,8 +308,8 @@ void addPush({ required String remote, required String refspec, }) { - final remoteC = remote.toChar(); - final refspecC = refspec.toChar(); + final remoteC = remote.toNativeUtf8().cast(); + final refspecC = refspec.toNativeUtf8().cast(); final error = libgit2.git_remote_add_push(repoPointer, remoteC, refspecC); calloc.free(remoteC); @@ -378,7 +375,7 @@ void connect({ /// Throws a [LibGit2Error] if error occured. List> lsRemotes(Pointer remote) { final out = calloc>>(); - final size = calloc(); + final size = calloc(); libgit2.git_remote_ls(out, size, remote); final result = >[]; @@ -390,11 +387,12 @@ List> lsRemotes(Pointer remote) { remote['local'] = local; remote['loid'] = local ? Oid.fromRaw(out[0][i].ref.loid) : null; - remote['name'] = - out[0][i].ref.name == nullptr ? '' : out[0][i].ref.name.toDartString(); + remote['name'] = out[0][i].ref.name == nullptr + ? '' + : out[0][i].ref.name.cast().toDartString(); remote['symref'] = out[0][i].ref.symref_target == nullptr ? '' - : out[0][i].ref.symref_target.toDartString(); + : out[0][i].ref.symref_target.cast().toDartString(); remote['oid'] = Oid.fromRaw(out[0][i].ref.oid); result.add(remote); @@ -421,8 +419,9 @@ void fetch({ String? proxyOption, }) { final refspecsC = calloc(); - final refspecsPointers = refspecs.map((e) => e.toChar()).toList(); - final strArray = calloc>(refspecs.length); + final refspecsPointers = + refspecs.map((e) => e.toNativeUtf8().cast()).toList(); + final strArray = calloc>(refspecs.length); for (var i = 0; i < refspecs.length; i++) { strArray[i] = refspecsPointers[i]; @@ -430,7 +429,7 @@ void fetch({ refspecsC.ref.count = refspecs.length; refspecsC.ref.strings = strArray; - final reflogMessageC = reflogMessage?.toChar() ?? nullptr; + final reflogMessageC = reflogMessage?.toNativeUtf8().cast() ?? nullptr; final proxyOptions = _proxyOptionsInit(proxyOption); @@ -476,8 +475,9 @@ void push({ String? proxyOption, }) { final refspecsC = calloc(); - final refspecsPointers = refspecs.map((e) => e.toChar()).toList(); - final strArray = calloc>(refspecs.length); + final refspecsPointers = + refspecs.map((e) => e.toNativeUtf8().cast()).toList(); + final strArray = calloc>(refspecs.length); for (var i = 0; i < refspecs.length; i++) { strArray[i] = refspecsPointers[i]; @@ -566,7 +566,7 @@ Pointer _proxyOptionsInit(String? proxyOption) { proxyOptions.ref.type = git_proxy_t.GIT_PROXY_AUTO; } else { proxyOptions.ref.type = git_proxy_t.GIT_PROXY_SPECIFIED; - proxyOptions.ref.url = proxyOption.toChar(); + proxyOptions.ref.url = proxyOption.toNativeUtf8().cast(); } return proxyOptions; diff --git a/lib/src/bindings/remote_callbacks.dart b/lib/src/bindings/remote_callbacks.dart index d1f0e1b..a6c7710 100644 --- a/lib/src/bindings/remote_callbacks.dart +++ b/lib/src/bindings/remote_callbacks.dart @@ -8,7 +8,6 @@ import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/remote.dart' as remote_bindings; import 'package:libgit2dart/src/bindings/repository.dart' as repository_bindings; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; class RemoteCallbacks { @@ -30,11 +29,11 @@ class RemoteCallbacks { /// Callback for messages received by the transport. static int sidebandProgressCb( - Pointer progressOutput, + Pointer progressOutput, int length, Pointer payload, ) { - sidebandProgress!(progressOutput.toDartString(length: length)); + sidebandProgress!(progressOutput.cast().toDartString(length: length)); return 0; } @@ -43,12 +42,12 @@ class RemoteCallbacks { /// A callback that will be called for every reference. static int updateTipsCb( - Pointer refname, + Pointer refname, Pointer oldOid, Pointer newOid, Pointer payload, ) { - updateTips!(refname.toDartString(), Oid(oldOid), Oid(newOid)); + updateTips!(refname.cast().toDartString(), Oid(oldOid), Oid(newOid)); return 0; } @@ -59,12 +58,13 @@ class RemoteCallbacks { /// not empty, the update was rejected by the remote server /// and [message] contains the reason given. static int pushUpdateReferenceCb( - Pointer refname, - Pointer message, + Pointer refname, + Pointer message, Pointer payload, ) { - final messageResult = message == nullptr ? '' : message.toDartString(); - pushUpdateReference!(refname.toDartString(), messageResult); + final messageResult = + message == nullptr ? '' : message.cast().toDartString(); + pushUpdateReference!(refname.cast().toDartString(), messageResult); return 0; } @@ -77,8 +77,8 @@ class RemoteCallbacks { static int remoteCb( Pointer> remote, Pointer repo, - Pointer name, - Pointer url, + Pointer name, + Pointer url, Pointer payload, ) { late final Pointer remotePointer; @@ -110,7 +110,7 @@ class RemoteCallbacks { /// A callback used to create the new repository into which to clone. static int repositoryCb( Pointer> repo, - Pointer path, + Pointer path, int bare, Pointer payload, ) { @@ -147,15 +147,15 @@ class RemoteCallbacks { /// requires authentication in order to connect to it. static int credentialsCb( Pointer> credPointer, - Pointer url, - Pointer username, + Pointer url, + Pointer username, int allowedTypes, Pointer payload, ) { - if (payload.cast().value == 2) { + if (payload.cast().value == 2) { libgit2.git_error_set_str( git_error_t.GIT_ERROR_INVALID, - 'Incorrect credentials.'.toChar(), + 'Incorrect credentials.'.toNativeUtf8().cast(), ); throw LibGit2Error(libgit2.git_error_last()); } @@ -165,7 +165,7 @@ class RemoteCallbacks { if (allowedTypes & credentialType.value != credentialType.value) { libgit2.git_error_set_str( git_error_t.GIT_ERROR_INVALID, - 'Invalid credential type $credentialType'.toChar(), + 'Invalid credential type $credentialType'.toNativeUtf8().cast(), ); throw LibGit2Error(libgit2.git_error_last()); } diff --git a/lib/src/bindings/repository.dart b/lib/src/bindings/repository.dart index a1d0a79..6727374 100644 --- a/lib/src/bindings/repository.dart +++ b/lib/src/bindings/repository.dart @@ -5,7 +5,6 @@ import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/remote_callbacks.dart'; import 'package:libgit2dart/src/callbacks.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/remote.dart'; import 'package:libgit2dart/src/repository.dart'; import 'package:libgit2dart/src/util.dart'; @@ -18,7 +17,7 @@ import 'package:libgit2dart/src/util.dart'; /// Throws a [LibGit2Error] if error occured. Pointer open(String path) { final out = calloc>(); - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final error = libgit2.git_repository_open(out, pathC); final result = out.value; @@ -45,15 +44,15 @@ String discover({ String? ceilingDirs, }) { final out = calloc(); - final startPathC = startPath.toChar(); - final ceilingDirsC = ceilingDirs?.toChar() ?? nullptr; + final startPathC = startPath.toNativeUtf8().cast(); + final ceilingDirsC = ceilingDirs?.toNativeUtf8().cast() ?? nullptr; libgit2.git_repository_discover(out, startPathC, 0, ceilingDirsC); calloc.free(startPathC); calloc.free(ceilingDirsC); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -76,12 +75,12 @@ Pointer init({ String? originUrl, }) { final out = calloc>(); - final pathC = path.toChar(); - final workdirPathC = workdirPath?.toChar() ?? nullptr; - final descriptionC = description?.toChar() ?? nullptr; - final templatePathC = templatePath?.toChar() ?? nullptr; - final initialHeadC = initialHead?.toChar() ?? nullptr; - final originUrlC = originUrl?.toChar() ?? nullptr; + final pathC = path.toNativeUtf8().cast(); + final workdirPathC = workdirPath?.toNativeUtf8().cast() ?? nullptr; + final descriptionC = description?.toNativeUtf8().cast() ?? nullptr; + final templatePathC = templatePath?.toNativeUtf8().cast() ?? nullptr; + final initialHeadC = initialHead?.toNativeUtf8().cast() ?? nullptr; + final originUrlC = originUrl?.toNativeUtf8().cast() ?? nullptr; final opts = calloc(); libgit2.git_repository_init_options_init( opts, @@ -125,14 +124,16 @@ Pointer clone({ required String localPath, required bool bare, RemoteCallback? remoteCallback, + // Repository Function(String, bool)? repository, RepositoryCallback? repositoryCallback, String? checkoutBranch, required Callbacks callbacks, }) { final out = calloc>(); - final urlC = url.toChar(); - final localPathC = localPath.toChar(); - final checkoutBranchC = checkoutBranch?.toChar() ?? nullptr; + final urlC = url.toNativeUtf8().cast(); + final localPathC = localPath.toNativeUtf8().cast(); + final checkoutBranchC = + checkoutBranch?.toNativeUtf8().cast() ?? nullptr; final cloneOptions = calloc(); libgit2.git_clone_options_init(cloneOptions, GIT_CLONE_OPTIONS_VERSION); @@ -187,7 +188,7 @@ Pointer clone({ /// Returns the path to the `.git` folder for normal repositories or the /// repository itself for bare repositories. String path(Pointer repo) { - return libgit2.git_repository_path(repo).toDartString(); + return libgit2.git_repository_path(repo).cast().toDartString(); } /// Get the path of the shared common directory for this repository. @@ -196,7 +197,7 @@ String path(Pointer repo) { /// If the repository is a worktree, it is the parent repo's `.git` folder. /// Otherwise, it is the `.git` folder. String commonDir(Pointer repo) { - return libgit2.git_repository_commondir(repo).toDartString(); + return libgit2.git_repository_commondir(repo).cast().toDartString(); } /// Get the currently active namespace for this repository. @@ -205,7 +206,11 @@ String commonDir(Pointer repo) { /// empty string is returned. String getNamespace(Pointer repo) { final result = libgit2.git_repository_get_namespace(repo); - return result == nullptr ? '' : result.toDartString(); + if (result == nullptr) { + return ''; + } else { + return result.cast().toDartString(); + } } /// Sets the active namespace for this repository. @@ -219,7 +224,7 @@ void setNamespace({ required Pointer repoPointer, String? namespace, }) { - final namespaceC = namespace?.toChar() ?? nullptr; + final namespaceC = namespace?.toNativeUtf8().cast() ?? nullptr; libgit2.git_repository_set_namespace(repoPointer, namespaceC); calloc.free(namespaceC); } @@ -306,8 +311,8 @@ void setIdentity({ String? name, String? email, }) { - final nameC = name?.toChar() ?? nullptr; - final emailC = email?.toChar() ?? nullptr; + final nameC = name?.toNativeUtf8().cast() ?? nullptr; + final emailC = email?.toNativeUtf8().cast() ?? nullptr; libgit2.git_repository_set_ident(repoPointer, nameC, emailC); @@ -319,16 +324,16 @@ void setIdentity({ /// /// Returns list with name and email respectively. List identity(Pointer repo) { - final name = calloc>(); - final email = calloc>(); + final name = calloc>(); + final email = calloc>(); libgit2.git_repository_ident(name, email, repo); final identity = []; if (name.value == nullptr && email.value == nullptr) { return identity; } else { - identity.add(name.value.toDartString()); - identity.add(email.value.toDartString()); + identity.add(name.value.cast().toDartString()); + identity.add(email.value.cast().toDartString()); } calloc.free(name); @@ -412,7 +417,7 @@ String message(Pointer repo) { final out = calloc(); final error = libgit2.git_repository_message(out, repo); - final result = out.ref.ptr.toDartString(length: out.ref.size); + final result = out.ref.ptr.cast().toDartString(length: out.ref.size); libgit2.git_buf_dispose(out); calloc.free(out); @@ -490,7 +495,7 @@ void setHead({ required Pointer repoPointer, required String refname, }) { - final refnameC = refname.toChar(); + final refnameC = refname.toNativeUtf8().cast(); final error = libgit2.git_repository_set_head(repoPointer, refnameC); calloc.free(refnameC); @@ -541,7 +546,7 @@ void setWorkdir({ required String path, required bool updateGitlink, }) { - final workdirC = path.toChar(); + final workdirC = path.toNativeUtf8().cast(); final updateGitlinkC = updateGitlink ? 1 : 0; final error = libgit2.git_repository_set_workdir( repoPointer, @@ -577,7 +582,12 @@ void stateCleanup(Pointer repo) { /// If the repository is bare, this function will always return empty string. String workdir(Pointer repo) { final result = libgit2.git_repository_workdir(repo); - return result == nullptr ? '' : result.toDartString(); + + if (result == nullptr) { + return ''; + } else { + return result.cast().toDartString(); + } } /// Free a previously allocated repository. diff --git a/lib/src/bindings/reset.dart b/lib/src/bindings/reset.dart index 7b45c3f..3f57a24 100644 --- a/lib/src/bindings/reset.dart +++ b/lib/src/bindings/reset.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Sets the current head to the specified commit oid and optionally resets the @@ -17,67 +16,30 @@ import 'package:libgit2dart/src/util.dart'; /// HARD reset will trigger a MIXED reset and the working directory will be /// replaced with the content of the index. (Untracked and ignored files will /// be left alone, however.) -/// -/// Throws a [LibGit2Error] if error occured. void reset({ required Pointer repoPointer, required Pointer targetPointer, required int resetType, - int? strategy, - String? checkoutDirectory, - List? pathspec, + required Pointer checkoutOptsPointer, }) { - final opts = calloc(); - libgit2.git_checkout_options_init(opts, GIT_CHECKOUT_OPTIONS_VERSION); - - if (strategy != null) { - opts.ref.checkout_strategy = strategy; - } - if (checkoutDirectory != null) { - opts.ref.target_directory = checkoutDirectory.toChar(); - } - var pathPointers = >[]; - Pointer> strArray = nullptr; - if (pathspec != null) { - pathPointers = pathspec.map((e) => e.toChar()).toList(); - strArray = calloc(pathspec.length); - for (var i = 0; i < pathspec.length; i++) { - strArray[i] = pathPointers[i]; - } - opts.ref.paths.strings = strArray; - opts.ref.paths.count = pathspec.length; - } - - final error = libgit2.git_reset(repoPointer, targetPointer, resetType, opts); - - for (final p in pathPointers) { - calloc.free(p); - } - calloc.free(strArray); - calloc.free(opts); - - if (error < 0) { - throw LibGit2Error(libgit2.git_error_last()); - } + libgit2.git_reset(repoPointer, targetPointer, resetType, checkoutOptsPointer); } /// Updates some entries in the index from the target commit tree. /// /// The scope of the updated entries is determined by the paths being passed in -/// the [pathspec] parameters. -/// -/// Passing a null [targetPointer] will result in removing entries in the index -/// matching the provided [pathspec]s. +/// the pathspec parameters. /// /// Throws a [LibGit2Error] if error occured. void resetDefault({ required Pointer repoPointer, - required Pointer? targetPointer, + required Pointer targetPointer, required List pathspec, }) { final pathspecC = calloc(); - final pathPointers = pathspec.map((e) => e.toChar()).toList(); - final strArray = calloc>(pathspec.length); + final pathPointers = + pathspec.map((e) => e.toNativeUtf8().cast()).toList(); + final strArray = calloc>(pathspec.length); for (var i = 0; i < pathspec.length; i++) { strArray[i] = pathPointers[i]; @@ -88,7 +50,7 @@ void resetDefault({ final error = libgit2.git_reset_default( repoPointer, - targetPointer ?? nullptr, + targetPointer, pathspecC, ); diff --git a/lib/src/bindings/revparse.dart b/lib/src/bindings/revparse.dart index 3452687..e59cbf4 100644 --- a/lib/src/bindings/revparse.dart +++ b/lib/src/bindings/revparse.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Parse a revision string for from, to, and intent. @@ -17,7 +16,7 @@ Pointer revParse({ required String spec, }) { final out = calloc(); - final specC = spec.toChar(); + final specC = spec.toNativeUtf8().cast(); final error = libgit2.git_revparse(out, repoPointer, specC); @@ -43,7 +42,7 @@ Pointer revParseSingle({ required String spec, }) { final out = calloc>(); - final specC = spec.toChar(); + final specC = spec.toNativeUtf8().cast(); final error = libgit2.git_revparse_single(out, repoPointer, specC); @@ -77,7 +76,7 @@ List revParseExt({ }) { final objectOut = calloc>(); final referenceOut = calloc>(); - final specC = spec.toChar(); + final specC = spec.toNativeUtf8().cast(); final error = libgit2.git_revparse_ext( objectOut, @@ -86,7 +85,8 @@ List revParseExt({ specC, ); - final result = [objectOut.value]; + final result = []; + result.add(objectOut.value); if (referenceOut.value != nullptr) { result.add(referenceOut.value); } diff --git a/lib/src/bindings/revwalk.dart b/lib/src/bindings/revwalk.dart index 1869067..8db49d3 100644 --- a/lib/src/bindings/revwalk.dart +++ b/lib/src/bindings/revwalk.dart @@ -4,7 +4,6 @@ import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/commit.dart' as commit_bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Allocate a new revision walker to iterate through a repo. The returned @@ -82,7 +81,7 @@ void pushGlob({ required Pointer walkerPointer, required String glob, }) { - final globC = glob.toChar(); + final globC = glob.toNativeUtf8().cast(); libgit2.git_revwalk_push_glob(walkerPointer, globC); calloc.free(globC); } @@ -100,7 +99,7 @@ void pushRef({ required Pointer walkerPointer, required String refName, }) { - final refNameC = refName.toChar(); + final refNameC = refName.toNativeUtf8().cast(); final error = libgit2.git_revwalk_push_ref(walkerPointer, refNameC); calloc.free(refNameC); @@ -120,7 +119,7 @@ void pushRange({ required Pointer walkerPointer, required String range, }) { - final rangeC = range.toChar(); + final rangeC = range.toNativeUtf8().cast(); final error = libgit2.git_revwalk_push_range(walkerPointer, rangeC); calloc.free(rangeC); @@ -145,12 +144,11 @@ void pushRange({ List> walk({ required Pointer repoPointer, required Pointer walkerPointer, - required int limit, }) { final result = >[]; var error = 0; - void next() { + while (error == 0) { final oid = calloc(); error = libgit2.git_revwalk_next(oid, walkerPointer); if (error == 0) { @@ -159,21 +157,10 @@ List> walk({ oidPointer: oid, ); result.add(commit); - calloc.free(oid); } else { - calloc.free(oid); - return; - } - } - - if (limit == 0) { - while (error == 0) { - next(); - } - } else { - for (var i = 0; i < limit; i++) { - next(); + break; } + calloc.free(oid); } return result; @@ -212,7 +199,7 @@ void hideGlob({ required Pointer walkerPointer, required String glob, }) { - final globC = glob.toChar(); + final globC = glob.toNativeUtf8().cast(); libgit2.git_revwalk_hide_glob(walkerPointer, globC); calloc.free(globC); } @@ -230,7 +217,7 @@ void hideRef({ required Pointer walkerPointer, required String refName, }) { - final refNameC = refName.toChar(); + final refNameC = refName.toNativeUtf8().cast(); final error = libgit2.git_revwalk_hide_ref(walkerPointer, refNameC); calloc.free(refNameC); diff --git a/lib/src/bindings/signature.dart b/lib/src/bindings/signature.dart index 81b260b..703e2d7 100644 --- a/lib/src/bindings/signature.dart +++ b/lib/src/bindings/signature.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Create a new action signature. The returned signature must be freed with @@ -20,8 +19,8 @@ Pointer create({ required int offset, }) { final out = calloc>(); - final nameC = name.toChar(); - final emailC = email.toChar(); + final nameC = name.toNativeUtf8().cast(); + final emailC = email.toNativeUtf8().cast(); final error = libgit2.git_signature_new(out, nameC, emailC, time, offset); final result = out.value; @@ -43,8 +42,8 @@ Pointer create({ /// Throws a [LibGit2Error] if error occured. Pointer now({required String name, required String email}) { final out = calloc>(); - final nameC = name.toChar(); - final emailC = email.toChar(); + final nameC = name.toNativeUtf8().cast(); + final emailC = email.toNativeUtf8().cast(); final error = libgit2.git_signature_now(out, nameC, emailC); final result = out.value; diff --git a/lib/src/bindings/stash.dart b/lib/src/bindings/stash.dart index 91cc4c5..f7b04ff 100644 --- a/lib/src/bindings/stash.dart +++ b/lib/src/bindings/stash.dart @@ -4,7 +4,6 @@ import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/checkout.dart' as checkout_bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/oid.dart'; import 'package:libgit2dart/src/stash.dart'; import 'package:libgit2dart/src/util.dart'; @@ -19,7 +18,7 @@ Pointer save({ required int flags, }) { final out = calloc(); - final messageC = message?.toChar() ?? nullptr; + final messageC = message?.toNativeUtf8().cast() ?? nullptr; final error = libgit2.git_stash_save( out, repoPointer, @@ -144,12 +143,16 @@ var _stashList = []; /// A callback function to iterate over all the stashed states. int _stashCb( int index, - Pointer message, + Pointer message, Pointer oid, Pointer payload, ) { _stashList.add( - Stash(index: index, message: message.toDartString(), oid: Oid(oid)), + Stash( + index: index, + message: message.cast().toDartString(), + oid: Oid(oid), + ), ); return 0; } diff --git a/lib/src/bindings/status.dart b/lib/src/bindings/status.dart index 57e33cf..4a60a2a 100644 --- a/lib/src/bindings/status.dart +++ b/lib/src/bindings/status.dart @@ -4,7 +4,6 @@ import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Gather file status information and populate the git_status_list. The @@ -63,8 +62,8 @@ Pointer getByIndex({ /// /// Throws a [LibGit2Error] if error occured. int file({required Pointer repoPointer, required String path}) { - final out = calloc(); - final pathC = path.toChar(); + final out = calloc(); + final pathC = path.toNativeUtf8().cast(); final error = libgit2.git_status_file(out, repoPointer, pathC); final result = out.value; diff --git a/lib/src/bindings/submodule.dart b/lib/src/bindings/submodule.dart index ce9755c..478d893 100644 --- a/lib/src/bindings/submodule.dart +++ b/lib/src/bindings/submodule.dart @@ -5,7 +5,6 @@ import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/remote_callbacks.dart'; import 'package:libgit2dart/src/callbacks.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// List of submodule paths. @@ -16,7 +15,7 @@ List _pathsList = []; /// Function to be called with the name of each submodule. int _listCb( Pointer submodule, - Pointer name, + Pointer name, Pointer payload, ) { _pathsList.add(path(submodule)); @@ -27,7 +26,7 @@ int _listCb( List list(Pointer repo) { const except = -1; final callback = Pointer.fromFunction< - Int Function(Pointer, Pointer, Pointer)>( + Int32 Function(Pointer, Pointer, Pointer)>( _listCb, except, ); @@ -51,7 +50,7 @@ Pointer lookup({ required String name, }) { final out = calloc>(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final error = libgit2.git_submodule_lookup(out, repoPointer, nameC); @@ -160,8 +159,8 @@ Pointer addSetup({ bool useGitlink = true, }) { final out = calloc>(); - final urlC = url.toChar(); - final pathC = path.toChar(); + final urlC = url.toNativeUtf8().cast(); + final pathC = path.toNativeUtf8().cast(); final useGitlinkC = useGitlink ? 1 : 0; final error = libgit2.git_submodule_add_setup( out, @@ -233,8 +232,8 @@ int status({ required String name, required int ignore, }) { - final out = calloc(); - final nameC = name.toChar(); + final out = calloc(); + final nameC = name.toNativeUtf8().cast(); libgit2.git_submodule_status(out, repoPointer, nameC, ignore); final result = out.value; @@ -270,7 +269,7 @@ void reload({ /// Get the name of submodule. String name(Pointer submodule) { - return libgit2.git_submodule_name(submodule).toDartString(); + return libgit2.git_submodule_name(submodule).cast().toDartString(); } /// Get the path to the submodule. @@ -278,12 +277,12 @@ String name(Pointer submodule) { /// The path is almost always the same as the submodule name, but the two /// are actually not required to match. String path(Pointer submodule) { - return libgit2.git_submodule_path(submodule).toDartString(); + return libgit2.git_submodule_path(submodule).cast().toDartString(); } /// Get the URL for the submodule. String url(Pointer submodule) { - return libgit2.git_submodule_url(submodule).toDartString(); + return libgit2.git_submodule_url(submodule).cast().toDartString(); } /// Set the URL for the submodule in the configuration. @@ -295,8 +294,8 @@ void setUrl({ required String name, required String url, }) { - final nameC = name.toChar(); - final urlC = url.toChar(); + final nameC = name.toNativeUtf8().cast(); + final urlC = url.toNativeUtf8().cast(); libgit2.git_submodule_set_url(repoPointer, nameC, urlC); @@ -307,7 +306,7 @@ void setUrl({ /// Get the branch for the submodule. String branch(Pointer submodule) { final result = libgit2.git_submodule_branch(submodule); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Set the branch for the submodule in the configuration. @@ -319,8 +318,8 @@ void setBranch({ required String name, required String branch, }) { - final nameC = name.toChar(); - final branchC = branch.toChar(); + final nameC = name.toNativeUtf8().cast(); + final branchC = branch.toNativeUtf8().cast(); libgit2.git_submodule_set_branch(repoPointer, nameC, branchC); @@ -370,7 +369,7 @@ void setIgnore({ required String name, required int ignore, }) { - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); libgit2.git_submodule_set_ignore(repoPointer, nameC, ignore); calloc.free(nameC); } @@ -390,7 +389,7 @@ void setUpdateRule({ required String name, required int update, }) { - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); libgit2.git_submodule_set_update(repoPointer, nameC, update); calloc.free(nameC); } diff --git a/lib/src/bindings/tag.dart b/lib/src/bindings/tag.dart index 3c6efff..1da55c0 100644 --- a/lib/src/bindings/tag.dart +++ b/lib/src/bindings/tag.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Fill a list with all the tags in the repository. @@ -13,16 +12,16 @@ List list(Pointer repo) { final out = calloc(); final error = libgit2.git_tag_list(out, repo); + final result = []; + if (error < 0) { calloc.free(out); throw LibGit2Error(libgit2.git_error_last()); } else { - final result = [ - for (var i = 0; i < out.ref.count; i++) out.ref.strings[i].toDartString() - ]; - + for (var i = 0; i < out.ref.count; i++) { + result.add(out.ref.strings[i].cast().toDartString()); + } calloc.free(out); - return result; } } @@ -81,12 +80,13 @@ Pointer targetOid(Pointer tag) => Pointer id(Pointer tag) => libgit2.git_tag_id(tag); /// Get the name of a tag. -String name(Pointer tag) => libgit2.git_tag_name(tag).toDartString(); +String name(Pointer tag) => + libgit2.git_tag_name(tag).cast().toDartString(); /// Get the message of a tag. String message(Pointer tag) { final result = libgit2.git_tag_message(tag); - return result == nullptr ? '' : result.toDartString(); + return result == nullptr ? '' : result.cast().toDartString(); } /// Get the tagger (author) of a tag. The returned signature must be freed. @@ -115,8 +115,8 @@ Pointer createAnnotated({ required bool force, }) { final out = calloc(); - final tagNameC = tagName.toChar(); - final messageC = message.toChar(); + final tagNameC = tagName.toNativeUtf8().cast(); + final messageC = message.toNativeUtf8().cast(); final error = libgit2.git_tag_create( out, repoPointer, @@ -155,7 +155,7 @@ Pointer createLightweight({ required bool force, }) { final out = calloc(); - final tagNameC = tagName.toChar(); + final tagNameC = tagName.toNativeUtf8().cast(); final error = libgit2.git_tag_create_lightweight( out, repoPointer, @@ -183,7 +183,7 @@ void delete({ required Pointer repoPointer, required String tagName, }) { - final tagNameC = tagName.toChar(); + final tagNameC = tagName.toNativeUtf8().cast(); final error = libgit2.git_tag_delete(repoPointer, tagNameC); calloc.free(tagNameC); diff --git a/lib/src/bindings/tree.dart b/lib/src/bindings/tree.dart index fa536b3..b25ff0d 100644 --- a/lib/src/bindings/tree.dart +++ b/lib/src/bindings/tree.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Get the id of a tree. @@ -60,7 +59,7 @@ Pointer getByName({ required Pointer treePointer, required String filename, }) { - final filenameC = filename.toChar(); + final filenameC = filename.toNativeUtf8().cast(); final result = libgit2.git_tree_entry_byname(treePointer, filenameC); calloc.free(filenameC); @@ -84,7 +83,7 @@ Pointer getByPath({ required String path, }) { final out = calloc>(); - final pathC = path.toChar(); + final pathC = path.toNativeUtf8().cast(); final error = libgit2.git_tree_entry_bypath(out, rootPointer, pathC); final result = out.value; @@ -108,7 +107,7 @@ Pointer entryId(Pointer entry) => /// Get the filename of a tree entry. String entryName(Pointer entry) => - libgit2.git_tree_entry_name(entry).toDartString(); + libgit2.git_tree_entry_name(entry).cast().toDartString(); /// Get the UNIX file attributes of a tree entry. int entryFilemode(Pointer entry) => diff --git a/lib/src/bindings/treebuilder.dart b/lib/src/bindings/treebuilder.dart index 5819cdb..cfac7db 100644 --- a/lib/src/bindings/treebuilder.dart +++ b/lib/src/bindings/treebuilder.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Create a new tree builder. The returned tree builder must be freed with @@ -54,7 +53,7 @@ Pointer getByFilename({ required Pointer builderPointer, required String filename, }) { - final filenameC = filename.toChar(); + final filenameC = filename.toNativeUtf8().cast(); final result = libgit2.git_treebuilder_get(builderPointer, filenameC); calloc.free(filenameC); @@ -83,7 +82,7 @@ void add({ required Pointer oidPointer, required int filemode, }) { - final filenameC = filename.toChar(); + final filenameC = filename.toNativeUtf8().cast(); final error = libgit2.git_treebuilder_insert( nullptr, builderPointer, @@ -106,7 +105,7 @@ void remove({ required Pointer builderPointer, required String filename, }) { - final filenameC = filename.toChar(); + final filenameC = filename.toNativeUtf8().cast(); final error = libgit2.git_treebuilder_remove(builderPointer, filenameC); calloc.free(filenameC); diff --git a/lib/src/bindings/worktree.dart b/lib/src/bindings/worktree.dart index 61923da..2d01fb5 100644 --- a/lib/src/bindings/worktree.dart +++ b/lib/src/bindings/worktree.dart @@ -4,7 +4,6 @@ import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/error.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; /// Add a new working tree. The returned worktree must be freed with [free]. @@ -21,8 +20,8 @@ Pointer create({ Pointer? refPointer, }) { final out = calloc>(); - final nameC = name.toChar(); - final pathC = path.toChar(); + final nameC = name.toNativeUtf8().cast(); + final pathC = path.toNativeUtf8().cast(); final opts = calloc(); libgit2.git_worktree_add_options_init(opts, GIT_WORKTREE_ADD_OPTIONS_VERSION); @@ -57,7 +56,7 @@ Pointer lookup({ required String name, }) { final out = calloc>(); - final nameC = name.toChar(); + final nameC = name.toNativeUtf8().cast(); final error = libgit2.git_worktree_lookup(out, repoPointer, nameC); final result = out.value; @@ -96,16 +95,8 @@ bool isPrunable(Pointer wt) { /// Prune working tree. /// /// Prune the working tree, that is remove the git data structures on disk. -void prune({required Pointer worktreePointer, int? flags}) { - final opts = calloc(); - libgit2.git_worktree_prune_options_init( - opts, - GIT_WORKTREE_PRUNE_OPTIONS_VERSION, - ); - - if (flags != null) opts.ref.flags = flags; - - libgit2.git_worktree_prune(worktreePointer, opts); +void prune(Pointer wt) { + libgit2.git_worktree_prune(wt, nullptr); } /// List names of linked working trees. @@ -119,24 +110,23 @@ List list(Pointer repo) { calloc.free(out); throw LibGit2Error(libgit2.git_error_last()); } else { - final result = [ - for (var i = 0; i < out.ref.count; i++) out.ref.strings[i].toDartString() - ]; - + final result = []; + for (var i = 0; i < out.ref.count; i++) { + result.add(out.ref.strings[i].cast().toDartString()); + } calloc.free(out); - return result; } } /// Retrieve the name of the worktree. String name(Pointer wt) { - return libgit2.git_worktree_name(wt).toDartString(); + return libgit2.git_worktree_name(wt).cast().toDartString(); } /// Retrieve the filesystem path for the worktree. String path(Pointer wt) { - return libgit2.git_worktree_path(wt).toDartString(); + return libgit2.git_worktree_path(wt).cast().toDartString(); } /// Check if worktree is locked. diff --git a/lib/src/blame.dart b/lib/src/blame.dart index d01ab57..3354218 100644 --- a/lib/src/blame.dart +++ b/lib/src/blame.dart @@ -1,12 +1,10 @@ import 'dart:collection'; import 'dart:ffi'; -import 'package:equatable/equatable.dart'; +import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/blame.dart' as bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; -import 'package:meta/meta.dart'; class Blame with IterableMixin { /// Returns the blame for a single file. @@ -122,8 +120,7 @@ final _finalizer = Finalizer>( ); // coverage:ignore-end -@immutable -class BlameHunk extends Equatable { +class BlameHunk { /// Initializes a new instance of the [BlameHunk] class from /// provided pointer to blame hunk object in memory. const BlameHunk._(this._blameHunkPointer); @@ -174,7 +171,8 @@ class BlameHunk extends Equatable { /// Path to the file where this hunk originated, as of the commit specified by /// [originCommitOid]. - String get originPath => _blameHunkPointer.ref.orig_path.toDartString(); + String get originPath => + _blameHunkPointer.ref.orig_path.cast().toDartString(); @override String toString() { @@ -185,19 +183,6 @@ class BlameHunk extends Equatable { 'originCommitter: $originCommitter, originCommitOid: $originCommitOid, ' 'originPath: $originPath}'; } - - @override - List get props => [ - linesCount, - isBoundary, - finalStartLineNumber, - finalCommitter, - finalCommitOid, - originStartLineNumber, - originCommitter, - originCommitOid, - originPath, - ]; } class _BlameIterator implements Iterator { diff --git a/lib/src/blob.dart b/lib/src/blob.dart index 5b27d78..8c629ae 100644 --- a/lib/src/blob.dart +++ b/lib/src/blob.dart @@ -1,18 +1,14 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/blob.dart' as bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:meta/meta.dart'; -@immutable -class Blob extends Equatable { +class Blob { /// Initializes a new instance of [Blob] class from provided pointer to /// blob object in memory. /// /// Note: For internal use. Use [Blob.lookup] instead. - @internal Blob(this._blobPointer) { _finalizer.attach(this, _blobPointer, detach: this); } @@ -31,7 +27,6 @@ class Blob extends Equatable { /// Pointer to memory address for allocated blob object. /// /// Note: For internal use. - @internal Pointer get pointer => _blobPointer; /// Creates a new blob from a [content] string and writes it to ODB. @@ -129,9 +124,6 @@ class Blob extends Equatable { String toString() { return 'Blob{oid: $oid, isBinary: $isBinary, size: $size}'; } - - @override - List get props => [oid]; } // coverage:ignore-start diff --git a/lib/src/branch.dart b/lib/src/branch.dart index c221105..0c63691 100644 --- a/lib/src/branch.dart +++ b/lib/src/branch.dart @@ -1,21 +1,17 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/branch.dart' as bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/reference.dart' as reference_bindings; -import 'package:meta/meta.dart'; -@immutable -class Branch extends Equatable { +class Branch { /// Initializes a new instance of [Branch] class from provided pointer to /// branch object in memory. /// /// Note: For internal use. Instead, use one of: /// - [Branch.create] /// - [Branch.lookup] - @internal Branch(this._branchPointer) { _finalizer.attach(this, _branchPointer, detach: this); } @@ -75,7 +71,6 @@ class Branch extends Equatable { /// Pointer to memory address for allocated branch object. /// /// Note: For internal use. - @internal Pointer get pointer => _branchPointer; /// Returns a list of branches that can be found in a [repo]sitory for @@ -233,9 +228,6 @@ class Branch extends Equatable { return 'Branch{name: $name, target: $target, isHead: $isHead, ' 'isCheckedOut: $isCheckedOut}'; } - - @override - List get props => [target, name]; } // coverage:ignore-start diff --git a/lib/src/commit.dart b/lib/src/commit.dart index 3cd7ef1..1f13b02 100644 --- a/lib/src/commit.dart +++ b/lib/src/commit.dart @@ -1,19 +1,15 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/commit.dart' as bindings; import 'package:libgit2dart/src/bindings/graph.dart' as graph_bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:meta/meta.dart'; -@immutable -class Commit extends Equatable { +class Commit { /// Initializes a new instance of [Commit] class from provided pointer to /// commit object in memory. /// /// Note: For internal use. Use [Commit.lookup] instead. - @internal Commit(this._commitPointer) { _finalizer.attach(this, _commitPointer, detach: this); } @@ -32,7 +28,6 @@ class Commit extends Equatable { /// Pointer to memory address for allocated commit object. /// /// Note: For internal use. - @internal Pointer get pointer => _commitPointer; /// Creates new commit in the [repo]sitory. @@ -191,64 +186,23 @@ class Commit extends Equatable { /// Reverts commit, producing changes in the index and working directory. /// - /// [mainline] is parent of the commit if it is a merge (i.e. 1, 2, etc.). - /// - /// [mergeFavor] is one of the optional [GitMergeFileFavor] flags for - /// handling conflicting content. - /// - /// [mergeFlags] is optional combination of [GitMergeFlag] flags. - /// - /// [mergeFileFlags] is optional combination of [GitMergeFileFlag] flags. - /// - /// [checkoutStrategy] is optional combination of [GitCheckout] flags. - /// - /// [checkoutDirectory] is optional alternative checkout path to workdir. - /// - /// [checkoutPaths] is optional list of files to checkout (by default all - /// paths are processed). - /// /// Throws a [LibGit2Error] if error occured. - void revert({ - int mainline = 0, - GitMergeFileFavor? mergeFavor, - Set? mergeFlags, - Set? mergeFileFlags, - Set? checkoutStrategy, - String? checkoutDirectory, - List? checkoutPaths, - }) { + void revert() { bindings.revert( repoPointer: bindings.owner(_commitPointer), commitPointer: _commitPointer, - mainline: mainline, - mergeFavor: mergeFavor?.value, - mergeFlags: mergeFlags?.fold(0, (acc, e) => acc! | e.value), - mergeFileFlags: mergeFileFlags?.fold(0, (acc, e) => acc! | e.value), - checkoutStrategy: checkoutStrategy?.fold(0, (acc, e) => acc! | e.value), - checkoutDirectory: checkoutDirectory, - checkoutPaths: checkoutPaths, ); } /// Reverts commit against provided [commit], producing an index that /// reflects the result of the revert. /// - /// [mainline] is parent of the commit if it is a merge (i.e. 1, 2, etc.). - /// - /// [mergeFavor] is one of the optional [GitMergeFileFavor] flags for - /// handling conflicting content. - /// - /// [mergeFlags] is optional combination of [GitMergeFlag] flags. - /// - /// [mergeFileFlags] is optional combination of [GitMergeFileFlag] flags. + /// [mainline] is parent of the commit if it is a merge (i.e. 1, 2). /// /// Throws a [LibGit2Error] if error occured. Index revertTo({ required Commit commit, int mainline = 0, - GitMergeFileFavor? mergeFavor, - Set? mergeFlags, - Set? mergeFileFlags, }) { return Index( bindings.revertCommit( @@ -256,9 +210,6 @@ class Commit extends Equatable { revertCommitPointer: _commitPointer, ourCommitPointer: commit.pointer, mainline: mainline, - mergeFavor: mergeFavor?.value, - mergeFlags: mergeFlags?.fold(0, (acc, e) => acc! | e.value), - mergeFileFlags: mergeFileFlags?.fold(0, (acc, e) => acc! | e.value), ), ); } @@ -310,11 +261,18 @@ class Commit extends Equatable { /// List of parent commits [Oid]s. List get parents { + final parents = []; final parentCount = bindings.parentCount(_commitPointer); - return [ - for (var i = 0; i < parentCount; i++) - Oid(bindings.parentId(commitPointer: _commitPointer, position: i)) - ]; + + for (var i = 0; i < parentCount; i++) { + final parentOid = bindings.parentId( + commitPointer: _commitPointer, + position: i, + ); + parents.add(Oid(parentOid)); + } + + return parents; } /// Returns the specified parent of the commit at provided 0-based [position]. @@ -380,9 +338,6 @@ class Commit extends Equatable { 'messageEncoding: $messageEncoding, time: $time, committer: $committer,' ' author: $author}'; } - - @override - List get props => [oid]; } // coverage:ignore-start diff --git a/lib/src/config.dart b/lib/src/config.dart index 5d236de..efbc796 100644 --- a/lib/src/config.dart +++ b/lib/src/config.dart @@ -2,14 +2,11 @@ import 'dart:collection'; import 'dart:ffi'; import 'dart:io'; -import 'package:equatable/equatable.dart'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/config.dart' as bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; -import 'package:meta/meta.dart'; class Config with IterableMixin { /// Initializes a new instance of [Config] class from provided @@ -20,7 +17,6 @@ class Config with IterableMixin { /// - [Config.system] /// - [Config.global] /// - [Config.xdg] - @internal Config(this._configPointer) { _finalizer.attach(this, _configPointer, detach: this); } @@ -100,8 +96,8 @@ class Config with IterableMixin { configPointer: _configPointer, variable: variable, ); - final name = entryPointer.ref.name.toDartString(); - final value = entryPointer.ref.value.toDartString(); + final name = entryPointer.ref.name.cast().toDartString(); + final value = entryPointer.ref.value.cast().toDartString(); final includeDepth = entryPointer.ref.include_depth; final level = GitConfigLevel.values.firstWhere( (e) => entryPointer.ref.level == e.value, @@ -213,9 +209,8 @@ final _finalizer = Finalizer>( ); // coverage:ignore-end -@immutable -class ConfigEntry extends Equatable { - const ConfigEntry._({ +class ConfigEntry { + ConfigEntry._({ required this.name, required this.value, required this.includeDepth, @@ -239,9 +234,6 @@ class ConfigEntry extends Equatable { return 'ConfigEntry{name: $name, value: $value, ' 'includeDepth: $includeDepth, level: $level}'; } - - @override - List get props => [name, value, includeDepth, level]; } class _ConfigIterator implements Iterator { @@ -266,8 +258,8 @@ class _ConfigIterator implements Iterator { } else { error = libgit2.git_config_next(entry, _iteratorPointer); if (error != -31) { - final name = entry.value.ref.name.toDartString(); - final value = entry.value.ref.value.toDartString(); + final name = entry.value.ref.name.cast().toDartString(); + final value = entry.value.ref.value.cast().toDartString(); final includeDepth = entry.value.ref.include_depth; final level = GitConfigLevel.values.firstWhere( (e) => entry.value.ref.level == e.value, diff --git a/lib/src/diff.dart b/lib/src/diff.dart index 3425ce2..bd1ce85 100644 --- a/lib/src/diff.dart +++ b/lib/src/diff.dart @@ -1,15 +1,12 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; +import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/diff.dart' as bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; -import 'package:meta/meta.dart'; -@immutable -class Diff extends Equatable { +class Diff { /// Initializes a new instance of [Diff] class from provided /// pointer to diff object in memory. /// @@ -21,7 +18,6 @@ class Diff extends Equatable { /// - [Diff.treeToWorkdirWithIndex] /// - [Diff.treeToTree] /// - [Diff.parse] - @internal Diff(this._diffPointer) { _finalizer.attach(this, _diffPointer, detach: this); } @@ -277,7 +273,6 @@ class Diff extends Equatable { /// Pointer to memory address for allocated diff object. /// /// Note: For internal use. - @internal Pointer get pointer => _diffPointer; /// How many diff records are there in a diff. @@ -287,18 +282,28 @@ class Diff extends Equatable { /// revisions. List get deltas { final length = bindings.length(_diffPointer); - return [ - for (var i = 0; i < length; i++) - DiffDelta(bindings.getDeltaByIndex(diffPointer: _diffPointer, index: i)) - ]; + final deltas = []; + for (var i = 0; i < length; i++) { + deltas.add( + DiffDelta( + bindings.getDeltaByIndex( + diffPointer: _diffPointer, + index: i, + ), + ), + ); + } + return deltas; } /// A List of [Patch]es. List get patches { final length = bindings.length(_diffPointer); - return [ - for (var i = 0; i < length; i++) Patch.fromDiff(diff: this, index: i) - ]; + final patches = []; + for (var i = 0; i < length; i++) { + patches.add(Patch.fromDiff(diff: this, index: i)); + } + return patches; } /// The patch diff text. @@ -456,11 +461,8 @@ class Diff extends Equatable { @override String toString() { - return 'Diff{length: $length, patchOid: $patchOid}'; + return 'Diff{length: $length}'; } - - @override - List get props => [patchOid]; } // coverage:ignore-start @@ -469,13 +471,9 @@ final _finalizer = Finalizer>( ); // coverage:ignore-end -@immutable -class DiffDelta extends Equatable { +class DiffDelta { /// Initializes a new instance of [DiffDelta] class from provided /// pointer to diff delta object in memory. - /// - /// Note: For internal use. - @internal const DiffDelta(this._diffDeltaPointer); /// Pointer to memory address for allocated diff delta object. @@ -521,16 +519,6 @@ class DiffDelta extends Equatable { return 'DiffDelta{status: $status, flags: $flags, similarity: $similarity, ' 'numberOfFiles: $numberOfFiles, oldFile: $oldFile, newFile: $newFile}'; } - - @override - List get props => [ - status, - flags, - similarity, - numberOfFiles, - oldFile, - newFile, - ]; } /// Description of one side of a delta. @@ -538,8 +526,7 @@ class DiffDelta extends Equatable { /// Although this is called a "file", it could represent a file, a symbolic /// link, a submodule commit id, or even a tree (although that only if you /// are tracking type changes or ignored/untracked directories). -@immutable -class DiffFile extends Equatable { +class DiffFile { /// Initializes a new instance of [DiffFile] class from provided diff file /// object. const DiffFile._(this._diffFile); @@ -551,7 +538,7 @@ class DiffFile extends Equatable { Oid get oid => Oid.fromRaw(_diffFile.id); /// Path to the entry relative to the working directory of the repository. - String get path => _diffFile.path.toDartString(); + String get path => _diffFile.path.cast().toDartString(); /// Size of the entry in bytes. int get size => _diffFile.size; @@ -573,9 +560,6 @@ class DiffFile extends Equatable { return 'DiffFile{oid: $oid, path: $path, size: $size, flags: $flags, ' 'mode: $mode}'; } - - @override - List get props => [oid, path, size, flags, mode]; } class DiffStats { @@ -583,7 +567,6 @@ class DiffStats { /// pointer to diff stats object in memory. /// /// Note: For internal use. - @internal DiffStats(this._diffStatsPointer) { _statsFinalizer.attach(this, _diffStatsPointer, detach: this); } diff --git a/lib/src/error.dart b/lib/src/error.dart index 5a52968..83cac80 100644 --- a/lib/src/error.dart +++ b/lib/src/error.dart @@ -1,18 +1,17 @@ // coverage:ignore-file import 'dart:ffi'; +import 'package:ffi/ffi.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; -import 'package:meta/meta.dart'; /// Details of the last error that occurred. class LibGit2Error { - /// Note: For internal use. - @internal LibGit2Error(this._errorPointer); final Pointer _errorPointer; @override - String toString() => _errorPointer.ref.message.toDartString(); + String toString() { + return _errorPointer.ref.message.cast().toDartString(); + } } diff --git a/lib/src/extensions.dart b/lib/src/extensions.dart deleted file mode 100644 index 9f12e06..0000000 --- a/lib/src/extensions.dart +++ /dev/null @@ -1,36 +0,0 @@ -// coverage:ignore-file - -import 'dart:ffi'; - -import 'package:ffi/ffi.dart'; -import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; - -extension IsValidSHA on String { - bool isValidSHA() { - final hexRegExp = RegExp(r'^[0-9a-fA-F]+$'); - return hexRegExp.hasMatch(this) && - (GIT_OID_MINPREFIXLEN <= length && GIT_OID_HEXSZ >= length); - } -} - -extension ToChar on String { - /// Creates a zero-terminated [Utf8] code-unit array from this String, - /// casts it to the C `char` type and returns allocated pointer to result. - Pointer toChar() => toNativeUtf8().cast(); -} - -extension ToDartString on Pointer { - /// Converts this UTF-8 encoded string to a Dart string. - /// - /// Decodes the UTF-8 code units of this zero-terminated byte array as - /// Unicode code points and creates a Dart string containing those code - /// points. - /// - /// If [length] is provided, zero-termination is ignored and the result can - /// contain NUL characters. - /// - /// If [length] is not provided, the returned string is the string up til but - /// not including the first NUL character. - String toDartString({int? length}) => - cast().toDartString(length: length); -} diff --git a/lib/src/git_types.dart b/lib/src/git_types.dart index 3659324..564e960 100644 --- a/lib/src/git_types.dart +++ b/lib/src/git_types.dart @@ -1173,37 +1173,3 @@ enum GitBlobFilter { const GitBlobFilter(this.value); final int value; } - -/// Flags for APIs that add files matching pathspec. -enum GitIndexAddOption { - defaults(0), - - /// Skip the checking of ignore rules. - force(1), - - /// Disable glob expansion and force exact matching of files in working - /// directory. - disablePathspecMatch(2), - - /// Check that each entry in the pathspec is an exact match to a filename on - /// disk is either not ignored or already in the index. - checkPathspec(4); - - const GitIndexAddOption(this.value); - final int value; -} - -/// Flags to alter working tree pruning behavior. -enum GitWorktree { - /// Prune working tree even if working tree is valid. - pruneValid(1), - - /// Prune working tree even if it is locked. - pruneLocked(2), - - /// Prune checked out working tree. - pruneWorkingTree(4); - - const GitWorktree(this.value); - final int value; -} diff --git a/lib/src/index.dart b/lib/src/index.dart index 63ab0be..803ac56 100644 --- a/lib/src/index.dart +++ b/lib/src/index.dart @@ -1,19 +1,16 @@ import 'dart:collection'; import 'dart:ffi'; -import 'package:equatable/equatable.dart'; +import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/index.dart' as bindings; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; -import 'package:meta/meta.dart'; class Index with IterableMixin { /// Initializes a new instance of [Index] class from provided /// pointer to index object in memory. /// /// Note: For internal use. - @internal Index(this._indexPointer) { _finalizer.attach(this, _indexPointer, detach: this); } @@ -32,7 +29,6 @@ class Index with IterableMixin { /// Pointer to memory address for allocated index object. /// /// Note: For internal use. - @internal Pointer get pointer => _indexPointer; /// Full path to the index file on disk. @@ -217,18 +213,9 @@ class Index with IterableMixin { /// that matches will be added to the index (either updating an existing /// entry or adding a new entry). /// - /// [flags] is optional combination of [GitIndexAddOption] flags. - /// /// Throws a [LibGit2Error] if error occured. - void addAll( - List pathspec, { - Set flags = const {GitIndexAddOption.defaults}, - }) { - bindings.addAll( - indexPointer: _indexPointer, - pathspec: pathspec, - flags: flags.fold(0, (acc, e) => acc | e.value), - ); + void addAll(List pathspec) { + bindings.addAll(indexPointer: _indexPointer, pathspec: pathspec); } /// Updates all index entries to match the working directory. @@ -336,12 +323,10 @@ final _finalizer = Finalizer>( ); // coverage:ignore-end -@immutable -class IndexEntry extends Equatable { +class IndexEntry { /// Initializes a new instance of [IndexEntry] class. /// /// Note: For internal use. - @internal const IndexEntry(this._indexEntryPointer); final Pointer _indexEntryPointer; @@ -349,7 +334,6 @@ class IndexEntry extends Equatable { /// Pointer to memory address for allocated index entry object. /// /// Note: For internal use. - @internal Pointer get pointer => _indexEntryPointer; /// [Oid] of the index entry. @@ -358,9 +342,10 @@ class IndexEntry extends Equatable { set oid(Oid oid) => _indexEntryPointer.ref.id = oid.pointer.ref; /// Path of the index entry. - String get path => _indexEntryPointer.ref.path.toDartString(); + String get path => _indexEntryPointer.ref.path.cast().toDartString(); - set path(String path) => _indexEntryPointer.ref.path = path.toChar(); + set path(String path) => + _indexEntryPointer.ref.path = path.toNativeUtf8().cast(); /// UNIX file attributes of a index entry. GitFilemode get mode { @@ -382,16 +367,12 @@ class IndexEntry extends Equatable { String toString() { return 'IndexEntry{oid: $oid, path: $path, mode: $mode, stage: $stage}'; } - - @override - List get props => [oid, path, mode, stage]; } class ConflictEntry { /// Initializes a new instance of [ConflictEntry] class. /// /// Note: For internal use. - @internal const ConflictEntry( this._indexPointer, this._path, diff --git a/lib/src/libgit2.dart b/lib/src/libgit2.dart index 44245fa..f0441f4 100644 --- a/lib/src/libgit2.dart +++ b/lib/src/libgit2.dart @@ -3,7 +3,6 @@ import 'dart:ffi'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; class Libgit2 { @@ -13,9 +12,9 @@ class Libgit2 { static String get version { libgit2.git_libgit2_init(); - final major = calloc(); - final minor = calloc(); - final rev = calloc(); + final major = calloc(); + final minor = calloc(); + final rev = calloc(); libgit2.git_libgit2_version(major, minor, rev); final version = '${major.value}.${minor.value}.${rev.value}'; @@ -36,509 +35,28 @@ class Libgit2 { .toSet(); } - /// Maximum mmap window size. - static int get mmapWindowSize { - libgit2.git_libgit2_init(); - - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_mwindow_size(out); - final result = out.value; - calloc.free(out); - - return result; - } - - static set mmapWindowSize(int value) { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_set_mwindow_size(value); - } - - /// Maximum memory that will be mapped in total by the library. - /// - /// The default (0) is unlimited. - static int get mmapWindowMappedLimit { - libgit2.git_libgit2_init(); - - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_mwindow_mapped_limit(out); - final result = out.value; - calloc.free(out); - - return result; - } - - static set mmapWindowMappedLimit(int value) { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_set_mwindow_mapped_limit(value); - } - - /// Maximum number of files that will be mapped at any time by the library. - /// - /// The default (0) is unlimited. - static int get mmapWindowFileLimit { - libgit2.git_libgit2_init(); - - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_mwindow_file_limit(out); - final result = out.value; - calloc.free(out); - - return result; - } - - static set mmapWindowFileLimit(int value) { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_set_mwindow_file_limit(value); - } - - /// Returns search path for a given [level] of config data. - /// - /// [level] must be one of: - /// - [GitConfigLevel.system] - /// - [GitConfigLevel.global] - /// - [GitConfigLevel.xdg] - /// - [GitConfigLevel.programData] - static String getConfigSearchPath(GitConfigLevel level) { - libgit2.git_libgit2_init(); - - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_search_path(level.value, out); - final result = out.ref.ptr.toDartString(length: out.ref.size); - - libgit2.git_buf_dispose(out); - calloc.free(out); - - return result; - } - - /// Sets the search path for a [level] of config data. The search path - /// applied to shared attributes and ignore files. - /// - /// [path] lists directories delimited by `:`. - /// Pass null to reset to the default (generally based on environment - /// variables). Use magic path `$PATH` to include the old value of the path - /// (if you want to prepend or append, for instance). - /// - /// [level] must be one of: - /// - [GitConfigLevel.system] - /// - [GitConfigLevel.global] - /// - [GitConfigLevel.xdg] - /// - [GitConfigLevel.programData] - static void setConfigSearchPath({ - required GitConfigLevel level, - required String? path, - }) { - libgit2.git_libgit2_init(); - - final pathC = path?.toChar() ?? nullptr; - libgit2Opts.git_libgit2_opts_set_search_path(level.value, pathC); - calloc.free(pathC); - } - - /// Sets the maximum data size for the given [type] of object to be - /// considered eligible for caching in memory. Setting the [value] to - /// zero means that that type of object will not be cached. - /// - /// Defaults to 0 for [GitObject.blob] (i.e. won't cache blobs) and 4k - /// for [GitObject.commit], [GitObject.tree] and [GitObject.tag]. - static void setCacheObjectLimit({ - required GitObject type, - required int value, - }) { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_set_cache_object_limit(type.value, value); - } - - /// Sets the maximum total data size that will be cached in memory - /// across all repositories before libgit2 starts evicting objects - /// from the cache. This is a soft limit, in that the library might - /// briefly exceed it, but will start aggressively evicting objects - /// from cache when that happens. - /// - /// The default cache size is 256MB. - static void setCacheMaxSize(int bytes) { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_set_cache_max_size(bytes); - } - - /// [CachedMemory] object containing current bytes in cache and the maximum - /// that would be allowed in the cache. - static CachedMemory get cachedMemory { - libgit2.git_libgit2_init(); - - final current = calloc(); - final allowed = calloc(); - libgit2Opts.git_libgit2_opts_get_cached_memory(current, allowed); - - final result = CachedMemory._( - current: current.value, - allowed: allowed.value, - ); - - calloc.free(current); - calloc.free(allowed); - return result; - } - - /// Enables caching. - static void enableCaching() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_caching(1); - } - - /// Disables caching completely. - /// - /// Because caches are repository-specific, disabling the cache - /// cannot immediately clear all cached objects, but each cache will - /// be cleared on the next attempt to update anything in it. - static void disableCaching() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_caching(0); - } - - /// Default template path. - static String get templatePath { - libgit2.git_libgit2_init(); - - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_template_path(out); - final result = out.ref.ptr.toDartString(length: out.ref.size); - - libgit2.git_buf_dispose(out); - calloc.free(out); - - return result; - } - - static set templatePath(String path) { - libgit2.git_libgit2_init(); - - final pathC = path.toChar(); - libgit2Opts.git_libgit2_opts_set_template_path(pathC); - - calloc.free(pathC); - } - - /// Sets the SSL certificate-authority locations. - /// - /// - [file] is the location of a file containing several - /// certificates concatenated together. - /// - [path] is the location of a directory holding several - /// certificates, one per file. - /// - /// Either parameter may be null, but not both. - /// - /// Throws [ArgumentError] if both arguments are null. - static void setSSLCertLocations({String? file, String? path}) { - if (file == null && path == null) { - throw ArgumentError("Both file and path can't be null"); - } else { - libgit2.git_libgit2_init(); - - final fileC = file?.toChar() ?? nullptr; - final pathC = path?.toChar() ?? nullptr; - - libgit2Opts.git_libgit2_opts_set_ssl_cert_locations(fileC, pathC); - - calloc.free(fileC); - calloc.free(pathC); - } - } - - /// Value of the User-Agent header. - /// - /// This value will be appended to "git/1.0", for compatibility with other - /// git clients. - static String get userAgent { - libgit2.git_libgit2_init(); - - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_user_agent(out); - final result = out.ref.ptr.toDartString(length: out.ref.size); - - libgit2.git_buf_dispose(out); - calloc.free(out); - - return result; - } - - static set userAgent(String userAgent) { - libgit2.git_libgit2_init(); - - final userAgentC = userAgent.toChar(); - libgit2Opts.git_libgit2_opts_set_user_agent(userAgentC); - - calloc.free(userAgentC); - } - - /// Enables strict input validation when creating new objects - /// to ensure that all inputs to the new objects are valid. - /// - /// For example, when this is enabled, the parent(s) and tree inputs - /// will be validated when creating a new commit. - /// - /// Enabled by default. - static void enableStrictObjectCreation() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_strict_object_creation(1); - } - - /// Disables strict input validation when creating new objects. - /// - /// Enabled by default. - static void disableStrictObjectCreation() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_strict_object_creation(0); - } - - /// Enables validation of a symbolic ref target when creating it. - /// - /// For example, `foobar` is not a valid ref, therefore `foobar` is - /// not a valid target for a symbolic ref by default, whereas - /// `refs/heads/foobar` is. - /// - /// Disabling this bypasses validation so that an arbitrary strings - /// such as `foobar` can be used for a symbolic ref target. - /// - /// Enabled by default. - static void enableStrictSymbolicRefCreation() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_strict_symbolic_ref_creation(1); - } - - /// Disables validation of a symbolic ref target when creating it. - /// - /// For example, `foobar` is not a valid ref, therefore `foobar` is - /// not a valid target for a symbolic ref by default, whereas - /// `refs/heads/foobar` is. - /// - /// Disabling this bypasses validation so that an arbitrary strings - /// such as `foobar` can be used for a symbolic ref target. - /// - /// Enabled by default. - static void disableStrictSymbolicRefCreation() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_strict_symbolic_ref_creation(0); - } - - /// Enables the use of "offset deltas" when creating packfiles, - /// and the negotiation of them when talking to a remote server. - /// - /// Offset deltas store a delta base location as an offset into the - /// packfile from the current location, which provides a shorter encoding - /// and thus smaller resultant packfiles. - /// - /// Enabled by default. - static void enableOffsetDelta() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_offset_delta(1); - } - - /// Disables the use of "offset deltas" when creating packfiles, - /// and the negotiation of them when talking to a remote server. - /// - /// Offset deltas store a delta base location as an offset into the - /// packfile from the current location, which provides a shorter encoding - /// and thus smaller resultant packfiles. - /// - /// Packfiles containing offset deltas can still be read. - /// - /// Enabled by default. - static void disableOffsetDelta() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_offset_delta(0); - } - - /// Enables synchronized writes of files in the gitdir using `fsync` - /// (or the platform equivalent) to ensure that new object data - /// is written to permanent storage, not simply cached. - /// - /// Disabled by default. - static void enableFsyncGitdir() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_fsync_gitdir(1); - } - - /// Disables synchronized writes of files in the gitdir using `fsync` - /// (or the platform equivalent). - /// - /// Disabled by default. - static void disableFsyncGitdir() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_fsync_gitdir(0); - } - - /// Enables strict verification of object hashsums when reading objects from - /// disk. - /// - /// This may impact performance due to an additional checksum calculation - /// on each object. - /// - /// Enabled by default. - static void enableStrictHashVerification() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_strict_hash_verification(1); - } - - /// Disables strict verification of object hashsums when reading objects from - /// disk. - /// - /// Enabled by default. - static void disableStrictHashVerification() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_strict_hash_verification(0); - } - - /// Enables check for unsaved changes in the index before beginning any - /// operation that reloads the index from disk (e.g., checkout). - /// - /// If there are unsaved changes, the instruction will fail (using - /// the FORCE flag to checkout will still overwrite these changes). - /// - /// Enabled by default. - static void enableUnsavedIndexSafety() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_unsaved_index_safety(1); - } - - /// Disables check for unsaved changes in the index before beginning any - /// operation that reloads the index from disk (e.g., checkout). - /// - /// If there are unsaved changes, the instruction will fail (using - /// the FORCE flag to checkout will still overwrite these changes). - /// - /// Enabled by default. - static void disableUnsavedIndexSafety() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_unsaved_index_safety(0); - } - - /// Maximum number of objects libgit2 will allow in a pack file when - /// downloading a pack file from a remote. This can be used to limit maximum - /// memory usage when fetching from an untrusted remote. - static int get packMaxObjects { - libgit2.git_libgit2_init(); - - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_pack_max_objects(out); - final result = out.value; - calloc.free(out); - - return result; - } - - static set packMaxObjects(int value) { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_set_pack_max_objects(value); - } - - /// Enables checks of .keep file existence to be skipped when accessing - /// packfiles. - static void enablePackKeepFileChecks() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_disable_pack_keep_file_checks(0); - } - - /// Disables checks of .keep file existence to be skipped when accessing - /// packfiles, which can help performance with remote filesystems. - static void disablePackKeepFileChecks() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_disable_pack_keep_file_checks(1); - } - - /// When connecting to a server using NTLM or Negotiate - /// authentication, use expect/continue when POSTing data. - /// - /// This option is not available on Windows. - static void enableHttpExpectContinue() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_http_expect_continue(1); - } - - /// When connecting to a server using NTLM or Negotiate - /// authentication, don't use expect/continue when POSTing data. - /// - /// This option is not available on Windows. - static void disableHttpExpectContinue() { - libgit2.git_libgit2_init(); - libgit2Opts.git_libgit2_opts_enable_http_expect_continue(0); - } - - /// List of git extensions that are supported. - /// - /// This is the list of built-in extensions supported by libgit2 and - /// custom extensions that have been added. - /// - /// Extensions supported by libgit2 may be negated by prefixing - /// them with a `!`. For example: setting extensions to - /// `"!noop", "newext"` indicates that the caller does not want - /// to support repositories with the `noop` extension but does want - /// to support repositories with the `newext` extension. - /// - /// Extensions that have been negated will not be returned. - static List get extensions { - libgit2.git_libgit2_init(); - - final array = calloc(); - libgit2Opts.git_libgit2_opts_get_extensions(array); - - final result = [ - for (var i = 0; i < array.ref.count; i++) - array.ref.strings.elementAt(i).value.toDartString() - ]; - - calloc.free(array); - - return result; - } - - static set extensions(List extensions) { - libgit2.git_libgit2_init(); - - final array = calloc>(extensions.length); - for (var i = 0; i < extensions.length; i++) { - array[i] = extensions[i].toChar(); - } - - libgit2Opts.git_libgit2_opts_set_extensions(array, extensions.length); - - for (var i = 0; i < extensions.length; i++) { - calloc.free(array[i]); - } - calloc.free(array); - } - /// Owner validation setting for repository directories. - /// - /// Enabled by default. static bool get ownerValidation { libgit2.git_libgit2_init(); - final out = calloc(); - libgit2Opts.git_libgit2_opts_get_owner_validation(out); + final out = calloc(); + libgit2.git_libgit2_opts( + git_libgit2_opt_t.GIT_OPT_GET_OWNER_VALIDATION, + out, + ); final result = out.value; calloc.free(out); return result == 1 || false; } + /// Sets owner validation setting for repository directories. static set ownerValidation(bool value) { libgit2.git_libgit2_init(); - final valueC = value ? 1 : 0; - libgit2Opts.git_libgit2_opts_set_owner_validation(valueC); - } -} - -/// Current bytes in cache and the maximum that would be allowed in the cache. -class CachedMemory { - const CachedMemory._({required this.current, required this.allowed}); - - final int current; - final int allowed; - - @override - String toString() { - return 'CachedMemory{current: $current, allowed: $allowed}'; + libgit2.git_libgit2_opts_set( + git_libgit2_opt_t.GIT_OPT_SET_OWNER_VALIDATION, + valueC, + ); } } diff --git a/lib/src/merge.dart b/lib/src/merge.dart index da080e0..015724b 100644 --- a/lib/src/merge.dart +++ b/lib/src/merge.dart @@ -265,43 +265,18 @@ class Merge { /// given common [ancestor] as the baseline, producing a string that reflects /// the merge result containing possible conflicts. /// - /// [ancestorLabel] is optional label for the ancestor file side of the - /// conflict which will be prepended to labels in diff3-format merge files. - /// - /// [oursLabel] is optional label for our file side of the conflict which - /// will be prepended to labels in merge files. - /// - /// [theirsLabel] is optional label for their file side of the conflict which - /// will be prepended to labels in merge files. - /// - /// [favor] is one of the [GitMergeFileFavor] flags for handling conflicting - /// content. Defaults to [GitMergeFileFavor.normal]. - /// - /// [flags] is a combination of [GitMergeFileFlag] flags. Defaults to - /// [GitMergeFileFlag.defaults]. - /// /// Throws a [LibGit2Error] if error occured. static String fileFromIndex({ required Repository repo, required IndexEntry? ancestor, - String ancestorLabel = '', required IndexEntry ours, - String oursLabel = '', required IndexEntry theirs, - String theirsLabel = '', - GitMergeFileFavor favor = GitMergeFileFavor.normal, - Set flags = const {GitMergeFileFlag.defaults}, }) { return bindings.mergeFileFromIndex( repoPointer: repo.pointer, ancestorPointer: ancestor?.pointer, - ancestorLabel: ancestorLabel, oursPointer: ours.pointer, - oursLabel: oursLabel, theirsPointer: theirs.pointer, - theirsLabel: theirsLabel, - favor: favor.value, - flags: flags.fold(0, (acc, e) => acc | e.value), ); } diff --git a/lib/src/note.dart b/lib/src/note.dart index f29aac0..54126e1 100644 --- a/lib/src/note.dart +++ b/lib/src/note.dart @@ -1,17 +1,13 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/note.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Note extends Equatable { +class Note { /// Initializes a new instance of the [Note] class from provided /// pointer to note and annotatedOid objects in memory. /// /// Note: For internal use. Use [Note.lookup] instead. - @internal Note(this._notePointer, this._annotatedOidPointer) { _finalizer.attach(this, _notePointer, detach: this); } @@ -115,17 +111,9 @@ class Note extends Equatable { /// Returns list of notes for [repo]sitory. /// - /// [notesRef] is the canonical name of the reference to use. Defaults to "refs/notes/commits". - /// /// Throws a [LibGit2Error] if error occured. - static List list( - Repository repo, { - String notesRef = 'refs/notes/commits', - }) { - final notesPointers = bindings.list( - repoPointer: repo.pointer, - notesRef: notesRef, - ); + static List list(Repository repo) { + final notesPointers = bindings.list(repo.pointer); return notesPointers .map( (e) => Note( @@ -155,9 +143,6 @@ class Note extends Equatable { String toString() { return 'Note{oid: $oid, message: $message, annotatedOid: $annotatedOid}'; } - - @override - List get props => [oid]; } // coverage:ignore-start diff --git a/lib/src/odb.dart b/lib/src/odb.dart index a3c486f..10f9aee 100644 --- a/lib/src/odb.dart +++ b/lib/src/odb.dart @@ -1,18 +1,14 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/odb.dart' as bindings; import 'package:libgit2dart/src/util.dart'; -import 'package:meta/meta.dart'; -@immutable -class Odb extends Equatable { +class Odb { /// Initializes a new instance of [Odb] class from provided /// pointer to Odb object in memory. /// /// Note: For internal use. - @internal Odb(this._odbPointer) { _finalizer.attach(this, _odbPointer, detach: this); } @@ -33,7 +29,6 @@ class Odb extends Equatable { /// Pointer to memory address for allocated oid object. /// /// Note: For internal use. - @internal Pointer get pointer => _odbPointer; /// Adds an on-disk alternate to an existing Object DB. @@ -106,9 +101,6 @@ class Odb extends Equatable { bindings.free(_odbPointer); _finalizer.detach(this); } - - @override - List get props => [objects]; } // coverage:ignore-start @@ -117,8 +109,7 @@ final _finalizer = Finalizer>( ); // coverage:ignore-end -@immutable -class OdbObject extends Equatable { +class OdbObject { /// Initializes a new instance of the [OdbObject] class from /// provided pointer to odbObject object in memory. OdbObject._(this._odbObjectPointer) { @@ -153,9 +144,6 @@ class OdbObject extends Equatable { String toString() { return 'OdbObject{oid: $oid, type: $type, size: $size}'; } - - @override - List get props => [oid]; } // coverage:ignore-start diff --git a/lib/src/oid.dart b/lib/src/oid.dart index 0e50b1b..d1387b9 100644 --- a/lib/src/oid.dart +++ b/lib/src/oid.dart @@ -1,20 +1,18 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/odb.dart' as odb_bindings; import 'package:libgit2dart/src/bindings/oid.dart' as bindings; -import 'package:libgit2dart/src/extensions.dart'; +import 'package:libgit2dart/src/util.dart'; import 'package:meta/meta.dart'; @immutable -class Oid extends Equatable { +class Oid { /// Initializes a new instance of [Oid] class from provided /// pointer to Oid object in memory. /// /// Note: For internal use. Use [Oid.fromSHA] instead. - @internal Oid(this._oidPointer); /// Initializes a new instance of [Oid] class by determining if an object can @@ -25,7 +23,7 @@ class Oid extends Equatable { /// /// Throws a [LibGit2Error] if error occured. Oid.fromSHA({required Repository repo, required String sha}) { - if (sha.isValidSHA()) { + if (isValidShaHex(sha)) { if (sha.length == 40) { _oidPointer = bindings.fromSHA(sha); } else { @@ -42,9 +40,6 @@ class Oid extends Equatable { /// Initializes a new instance of [Oid] class from provided raw git_oid /// structure. - /// - /// Note: For internal use. - @internal Oid.fromRaw(git_oid raw) { _oidPointer = bindings.fromRaw(raw.id); } @@ -54,12 +49,18 @@ class Oid extends Equatable { /// Pointer to memory address for allocated oid object. /// /// Note: For internal use. - @internal Pointer get pointer => _oidPointer; /// Hexadecimal SHA string. String get sha => bindings.toSHA(_oidPointer); + @override + bool operator ==(Object other) { + return (other is Oid) && + (bindings.compare(aPointer: _oidPointer, bPointer: other._oidPointer) == + 0); + } + bool operator <(Oid other) { return bindings.compare( aPointer: _oidPointer, @@ -92,9 +93,9 @@ class Oid extends Equatable { 1; } - @override - String toString() => 'Oid{sha: $sha}'; + @override // coverage:ignore-line + int get hashCode => _oidPointer.address.hashCode; // coverage:ignore-line @override - List get props => [sha]; + String toString() => 'Oid{sha: $sha}'; } diff --git a/lib/src/packbuilder.dart b/lib/src/packbuilder.dart index c9a9ea6..f151b07 100644 --- a/lib/src/packbuilder.dart +++ b/lib/src/packbuilder.dart @@ -2,7 +2,6 @@ import 'dart:ffi'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/packbuilder.dart' as bindings; -import 'package:meta/meta.dart'; class PackBuilder { /// Initializes a new instance of [PackBuilder] class. @@ -10,7 +9,6 @@ class PackBuilder { /// Throws a [LibGit2Error] if error occured. /// /// Note: For internal use. - @internal PackBuilder(Repository repo) { _packbuilderPointer = bindings.init(repo.pointer); _finalizer.attach(this, _packbuilderPointer, detach: this); diff --git a/lib/src/patch.dart b/lib/src/patch.dart index c837afa..d6cf4e5 100644 --- a/lib/src/patch.dart +++ b/lib/src/patch.dart @@ -1,15 +1,12 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/patch.dart' as bindings; import 'package:libgit2dart/src/util.dart'; -import 'package:meta/meta.dart'; -@immutable -class Patch extends Equatable { +class Patch { /// Initializes a new instance of [Patch] class from provided /// pointer to patch object in memory and pointers to old and new blobs/buffers. /// @@ -18,7 +15,6 @@ class Patch extends Equatable { /// - [Patch.fromBlobAndBuffer] /// - [Patch.fromBuffers] /// - [Patch.fromDiff] - @internal Patch(this._patchPointer) { _finalizer.attach(this, _patchPointer, detach: this); } @@ -238,10 +234,10 @@ class Patch extends Equatable { ); } - final intHeader = [ - for (var i = 0; i < hunkPointer.ref.header_len; i++) - hunkPointer.ref.header[i] - ]; + final intHeader = []; + for (var i = 0; i < hunkPointer.ref.header_len; i++) { + intHeader.add(hunkPointer.ref.header[i]); + } hunks.add( DiffHunk._( @@ -268,9 +264,6 @@ class Patch extends Equatable { @override String toString() => 'Patch{size: ${size()}, delta: $delta}'; - - @override - List get props => [delta]; } // coverage:ignore-start @@ -303,8 +296,7 @@ class PatchStats { } } -@immutable -class DiffHunk extends Equatable { +class DiffHunk { const DiffHunk._({ required this.linesCount, required this.index, @@ -346,22 +338,9 @@ class DiffHunk extends Equatable { 'oldStart: $oldStart, oldLines: $oldLines, newStart: $newStart, ' 'newLines: $newLines, header: $header}'; } - - @override - List get props => [ - linesCount, - index, - oldStart, - oldLines, - newStart, - newLines, - header, - lines - ]; } -@immutable -class DiffLine extends Equatable { +class DiffLine { const DiffLine._({ required this.origin, required this.oldLineNumber, @@ -395,14 +374,4 @@ class DiffLine extends Equatable { 'newLineNumber: $newLineNumber, numLines: $numLines, ' 'contentOffset: $contentOffset, content: $content}'; } - - @override - List get props => [ - origin, - oldLineNumber, - newLineNumber, - numLines, - contentOffset, - content, - ]; } diff --git a/lib/src/rebase.dart b/lib/src/rebase.dart index 735e517..f3def74 100644 --- a/lib/src/rebase.dart +++ b/lib/src/rebase.dart @@ -47,13 +47,18 @@ class Rebase { /// List of operations that are to be applied. List get operations { + final result = []; final operationsCount = bindings.operationsCount(_rebasePointer); - return [ - for (var i = 0; i < operationsCount; i++) - RebaseOperation._( - bindings.getOperationByIndex(rebase: _rebasePointer, index: i), - ) - ]; + + for (var i = 0; i < operationsCount; i++) { + final operation = bindings.getOperationByIndex( + rebase: _rebasePointer, + index: i, + ); + result.add(RebaseOperation._(operation)); + } + + return result; } /// Index of the rebase operation that is currently being applied. If the diff --git a/lib/src/reference.dart b/lib/src/reference.dart index c5d4471..8ea93c7 100644 --- a/lib/src/reference.dart +++ b/lib/src/reference.dart @@ -1,6 +1,5 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/object.dart' as object_bindings; @@ -8,16 +7,13 @@ import 'package:libgit2dart/src/bindings/refdb.dart' as refdb_bindings; import 'package:libgit2dart/src/bindings/reference.dart' as bindings; import 'package:libgit2dart/src/bindings/repository.dart' as repository_bindings; -import 'package:meta/meta.dart'; -@immutable -class Reference extends Equatable { +class Reference { /// Initializes a new instance of the [Reference] class. /// /// Note: For internal use. Instead, use one of: /// - [Reference.create] /// - [Reference.lookup] - @internal Reference(this._refPointer) { _finalizer.attach(this, _refPointer, detach: this); } @@ -83,12 +79,11 @@ class Reference extends Equatable { _finalizer.attach(this, _refPointer, detach: this); } - late final Pointer _refPointer; + late Pointer _refPointer; /// Pointer to memory address for allocated reference object. /// /// Note: For internal use. - @internal Pointer get pointer => _refPointer; /// Deletes an existing reference with provided [name]. @@ -129,39 +124,6 @@ class Reference extends Equatable { ); } - /// Updates the [target] of reference with provided [name]. - /// - /// [target] being either Oid for direct reference or string reference name - /// for symbolic reference. - /// - /// Throws a [LibGit2Error] if error occured or [ArgumentError] if [target] - /// is not [Oid] or string. - static void setTarget({ - required Repository repo, - required String name, - required Object target, - String? logMessage, - }) { - final ref = Reference.lookup(repo: repo, name: name); - if (target is Oid) { - bindings.setTarget( - refPointer: ref.pointer, - oidPointer: target.pointer, - logMessage: logMessage, - ); - } else if (target is String) { - bindings.setTargetSymbolic( - refPointer: ref.pointer, - target: target, - logMessage: logMessage, - ); - } else { - throw ArgumentError.value( - '$target must be either Oid or String reference name', - ); - } - } - /// List of all the references names that can be found in a [repo]sitory. /// /// Throws a [LibGit2Error] if error occured. @@ -205,9 +167,43 @@ class Reference extends Equatable { /// /// Throws an [Exception] if error occured. Oid get target { - return type == ReferenceType.direct - ? Oid(bindings.target(_refPointer)) - : Oid(bindings.target(bindings.resolve(_refPointer))); + late final Pointer oidPointer; + + if (type == ReferenceType.direct) { + oidPointer = bindings.target(_refPointer); + } else { + oidPointer = bindings.target(bindings.resolve(_refPointer)); + } + return Oid(oidPointer); + } + + /// Updates the [target] of this reference. + /// + /// [target] being either Oid for direct reference or string reference name + /// for symbolic reference. + /// + /// Throws a [LibGit2Error] if error occured or [ArgumentError] if [target] + /// is not [Oid] or string. + void setTarget({required Object target, String? logMessage}) { + if (target is Oid) { + final newPointer = bindings.setTarget( + refPointer: _refPointer, + oidPointer: target.pointer, + logMessage: logMessage, + ); + _refPointer = newPointer; + } else if (target is String) { + final newPointer = bindings.setTargetSymbolic( + refPointer: _refPointer, + target: target, + logMessage: logMessage, + ); + _refPointer = newPointer; + } else { + throw ArgumentError.value( + '$target must be either Oid or String reference name', + ); + } } /// Recursively peel reference until object of the specified [type] is found. @@ -276,6 +272,17 @@ class Reference extends Equatable { /// Whether reference is a tag. bool get isTag => bindings.isTag(_refPointer); + /// Compares two references. + bool equals(Reference other) { + return bindings.compare( + ref1Pointer: _refPointer, + ref2Pointer: other._refPointer, + ); + } + + /// Compares two references. + bool notEquals(Reference other) => !equals(other); + /// Releases memory allocated for reference object. void free() { bindings.free(_refPointer); @@ -288,9 +295,6 @@ class Reference extends Equatable { 'isBranch: $isBranch, isNote: $isNote, isRemote: $isRemote, ' 'isTag: $isTag}'; } - - @override - List get props => [target]; } // coverage:ignore-start diff --git a/lib/src/reflog.dart b/lib/src/reflog.dart index 998d2f6..ac71bb3 100644 --- a/lib/src/reflog.dart +++ b/lib/src/reflog.dart @@ -1,11 +1,9 @@ import 'dart:collection'; import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/reference.dart' as reference_bindings; import 'package:libgit2dart/src/bindings/reflog.dart' as bindings; -import 'package:meta/meta.dart'; class RefLog with IterableMixin { /// Initializes a new instance of [RefLog] class from provided [Reference]. @@ -111,8 +109,7 @@ final _finalizer = Finalizer>( ); // coverage:ignore-end -@immutable -class RefLogEntry extends Equatable { +class RefLogEntry { /// Initializes a new instance of [RefLogEntry] class from provided /// pointer to RefLogEntry object in memory. const RefLogEntry._(this._entryPointer); @@ -136,9 +133,6 @@ class RefLogEntry extends Equatable { @override String toString() => 'RefLogEntry{message: $message, committer: $committer}'; - - @override - List get props => [message, committer, newOid, oldOid]; } class _RefLogIterator implements Iterator { diff --git a/lib/src/refspec.dart b/lib/src/refspec.dart index 66c9405..c66059f 100644 --- a/lib/src/refspec.dart +++ b/lib/src/refspec.dart @@ -1,17 +1,13 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/refspec.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Refspec extends Equatable { +class Refspec { /// Initializes a new instance of the [Refspec] class /// from provided pointer to refspec object in memory. /// /// Note: For internal use. - @internal const Refspec(this._refspecPointer); /// Pointer to memory address for allocated refspec object. @@ -76,9 +72,6 @@ class Refspec extends Equatable { @override String toString() { return 'Refspec{source: $source, destination: $destination, force: $force, ' - 'string: $string, direction: $direction}'; + 'string: $string}'; } - - @override - List get props => [source, destination, force, string, direction]; } diff --git a/lib/src/remote.dart b/lib/src/remote.dart index d74dbf3..7ba5120 100644 --- a/lib/src/remote.dart +++ b/lib/src/remote.dart @@ -1,12 +1,9 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/remote.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Remote extends Equatable { +class Remote { /// Lookups remote with provided [name] in a [repo]sitory. /// /// The [name] will be checked for validity. @@ -211,16 +208,20 @@ class Remote extends Equatable { final refs = bindings.lsRemotes(_remotePointer); bindings.disconnect(_remotePointer); - return [ - for (final ref in refs) + final result = []; + for (final ref in refs) { + result.add( RemoteReference._( isLocal: ref['local']! as bool, localId: ref['loid'] as Oid?, name: ref['name']! as String, oid: ref['oid']! as Oid, symRef: ref['symref']! as String, - ) - ]; + ), + ); + } + + return result; } /// Downloads new data and updates tips. @@ -309,9 +310,6 @@ class Remote extends Equatable { return 'Remote{name: $name, url: $url, pushUrl: $pushUrl, ' 'refspecCount: $refspecCount}'; } - - @override - List get props => [name]; } // coverage:ignore-start @@ -327,7 +325,6 @@ class TransferProgress { /// pointer to transfer progress object in memory. /// /// Note: For internal use. - @internal const TransferProgress(this._transferProgressPointer); /// Pointer to memory address for allocated transfer progress object. @@ -381,8 +378,7 @@ class RemoteCallback { final String? fetch; } -@immutable -class RemoteReference extends Equatable { +class RemoteReference { const RemoteReference._({ required this.isLocal, required this.localId, @@ -412,7 +408,4 @@ class RemoteReference extends Equatable { return 'RemoteReference{isLocal: $isLocal, localId: $localId, ' 'name: $name, oid: $oid, symRef: $symRef}'; } - - @override - List get props => [isLocal, localId, name, oid, symRef]; } diff --git a/lib/src/repository.dart b/lib/src/repository.dart index 03c7190..372fb15 100644 --- a/lib/src/repository.dart +++ b/lib/src/repository.dart @@ -1,8 +1,8 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; + import 'package:libgit2dart/src/bindings/attr.dart' as attr_bindings; import 'package:libgit2dart/src/bindings/describe.dart' as describe_bindings; import 'package:libgit2dart/src/bindings/graph.dart' as graph_bindings; @@ -12,10 +12,8 @@ import 'package:libgit2dart/src/bindings/repository.dart' as bindings; import 'package:libgit2dart/src/bindings/reset.dart' as reset_bindings; import 'package:libgit2dart/src/bindings/status.dart' as status_bindings; import 'package:libgit2dart/src/util.dart'; -import 'package:meta/meta.dart'; -@immutable -class Repository extends Equatable { +class Repository { /// Initializes a new instance of the [Repository] class from provided /// pointer to repository object in memory. /// @@ -23,7 +21,6 @@ class Repository extends Equatable { /// - [Repository.init] /// - [Repository.open] /// - [Repository.clone] - @internal Repository(Pointer pointer) { _repoPointer = pointer; _finalizer.attach(this, _repoPointer, detach: this); @@ -162,7 +159,6 @@ class Repository extends Equatable { /// Pointer to memory address for allocated repository object. /// /// Note: For internal use. - @internal Pointer get pointer => _repoPointer; /// Looks for a git repository and return its path. The lookup start from @@ -557,23 +553,8 @@ class Repository extends Equatable { /// /// [resetType] is one of the [GitReset] flags. /// - /// [strategy], [checkoutDirectory] and [pathspec] are optional checkout - /// options to be used for a HARD reset. - /// - /// [strategy] is optional combination of [GitCheckout] flags. - /// - /// [checkoutDirectory] is optional alternative checkout path to workdir. - /// - /// [pathspec] is optional list of files to checkout. - /// /// Throws a [LibGit2Error] if error occured. - void reset({ - required Oid oid, - required GitReset resetType, - Set? strategy, - String? checkoutDirectory, - List? pathspec, - }) { + void reset({required Oid oid, required GitReset resetType}) { final object = object_bindings.lookup( repoPointer: _repoPointer, oidPointer: oid.pointer, @@ -584,9 +565,7 @@ class Repository extends Equatable { repoPointer: _repoPointer, targetPointer: object, resetType: resetType.value, - strategy: strategy?.fold(0, (acc, e) => acc! | e.value), - checkoutDirectory: checkoutDirectory, - pathspec: pathspec, + checkoutOptsPointer: nullptr, ); object_bindings.free(object); @@ -597,19 +576,13 @@ class Repository extends Equatable { /// The scope of the updated entries is determined by the paths being passed /// in the [pathspec]. /// - /// Passing a null [oid] will result in removing entries in the index - /// matching the provided [pathspec]s. - /// /// Throws a [LibGit2Error] if error occured. - void resetDefault({required Oid? oid, required List pathspec}) { - Pointer? object; - if (oid != null) { - object = object_bindings.lookup( - repoPointer: _repoPointer, - oidPointer: oid.pointer, - type: GitObject.commit.value, - ); - } + void resetDefault({required Oid oid, required List pathspec}) { + final object = object_bindings.lookup( + repoPointer: _repoPointer, + oidPointer: oid.pointer, + type: GitObject.commit.value, + ); reset_bindings.resetDefault( repoPointer: _repoPointer, @@ -768,9 +741,6 @@ class Repository extends Equatable { return packbuilder.writtenLength; } - - @override - List get props => [path]; } // coverage:ignore-start @@ -851,14 +821,10 @@ class RepositoryCallback { final String? originUrl; } -@immutable -class Identity extends Equatable { +class Identity { /// Identity to use for reflogs. const Identity({required this.name, required this.email}); final String name; final String email; - - @override - List get props => [name, email]; } diff --git a/lib/src/revparse.dart b/lib/src/revparse.dart index e413939..5df8a63 100644 --- a/lib/src/revparse.dart +++ b/lib/src/revparse.dart @@ -22,9 +22,11 @@ class RevParse { spec: spec, ); object = Commit(pointers[0].cast()); - reference = pointers.length == 2 - ? Reference(pointers[1].cast()) - : null; + if (pointers.length == 2) { + reference = Reference(pointers[1].cast()); + } else { + reference = null; + } } /// Object found by a revision string. diff --git a/lib/src/revwalk.dart b/lib/src/revwalk.dart index 78b8491..c3a08c7 100644 --- a/lib/src/revwalk.dart +++ b/lib/src/revwalk.dart @@ -2,7 +2,6 @@ import 'dart:ffi'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/revwalk.dart' as bindings; -import 'package:meta/meta.dart'; class RevWalk { /// Initializes a new instance of the [RevWalk] class. @@ -16,20 +15,15 @@ class RevWalk { /// Pointer to memory address for allocated [RevWalk] object. /// /// Note: For internal use. - @internal Pointer get pointer => _revWalkPointer; /// Returns the list of commits from the revision walk. /// - /// [limit] is optional number of commits to walk (by default walks through - /// all of the commits pushed onto the walker). - /// /// Default sorting is reverse chronological order (default in git). - List walk({int limit = 0}) { + List walk() { final pointers = bindings.walk( repoPointer: bindings.repository(_revWalkPointer), walkerPointer: _revWalkPointer, - limit: limit, ); return pointers.map((e) => Commit(e)).toList(); diff --git a/lib/src/signature.dart b/lib/src/signature.dart index 620b33c..aa4dcda 100644 --- a/lib/src/signature.dart +++ b/lib/src/signature.dart @@ -1,22 +1,19 @@ import 'dart:ffi'; - -import 'package:equatable/equatable.dart'; +import 'package:ffi/ffi.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/signature.dart' as bindings; -import 'package:libgit2dart/src/extensions.dart'; import 'package:libgit2dart/src/util.dart'; import 'package:meta/meta.dart'; @immutable -class Signature extends Equatable { +class Signature { /// Initializes a new instance of [Signature] class from provided pointer to /// signature object in memory. /// /// Note: For internal use. Instead, use one of: /// - [Signature.create] /// - [Signature.defaultSignature] - @internal Signature(Pointer pointer) { _signaturePointer = bindings.duplicate(pointer); _finalizer.attach(this, _signaturePointer, detach: this); @@ -63,14 +60,13 @@ class Signature extends Equatable { /// Pointer to memory address for allocated signature object. /// /// Note: For internal use. - @internal Pointer get pointer => _signaturePointer; /// Full name of the author. - String get name => _signaturePointer.ref.name.toDartString(); + String get name => _signaturePointer.ref.name.cast().toDartString(); /// Email of the author. - String get email => _signaturePointer.ref.email.toDartString(); + String get email => _signaturePointer.ref.email.cast().toDartString(); /// Time in seconds from epoch. int get time => _signaturePointer.ref.when.time; @@ -78,8 +74,16 @@ class Signature extends Equatable { /// Timezone offset in minutes. int get offset => _signaturePointer.ref.when.offset; - /// Indicator for questionable '-0000' offsets in signature. - String get sign => String.fromCharCode(_signaturePointer.ref.when.sign); + @override + bool operator ==(Object other) { + return (other is Signature) && + (name == other.name) && + (email == other.email) && + (time == other.time) && + (offset == other.offset) && + (_signaturePointer.ref.when.sign == + other._signaturePointer.ref.when.sign); + } /// Releases memory allocated for signature object. void free() { @@ -87,14 +91,15 @@ class Signature extends Equatable { _finalizer.detach(this); } + @override // coverage:ignore-line + int get hashCode => + _signaturePointer.address.hashCode; // coverage:ignore-line + @override String toString() { return 'Signature{name: $name, email: $email, time: $time, ' - 'offset: $sign$offset}'; + 'offset: $offset}'; } - - @override - List get props => [name, email, time, offset, sign]; } // coverage:ignore-start diff --git a/lib/src/stash.dart b/lib/src/stash.dart index bbd1267..1ab04e8 100644 --- a/lib/src/stash.dart +++ b/lib/src/stash.dart @@ -1,15 +1,9 @@ -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/stash.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Stash extends Equatable { +class Stash { /// Initializes a new instance of [Stash] class from provided stash [index], /// [message] and [oid]. - /// - /// Note: For internal use. Use [Stash.create] instead to create stash. - @internal const Stash({ required this.index, required this.message, @@ -46,12 +40,14 @@ class Stash extends Equatable { String? message, Set flags = const {GitStash.defaults}, }) { + final flagsInt = flags.fold(0, (int acc, e) => acc | e.value); + return Oid( bindings.save( repoPointer: repo.pointer, stasherPointer: stasher.pointer, message: message, - flags: flags.fold(0, (int acc, e) => acc | e.value), + flags: flagsInt, ), ); } @@ -150,7 +146,4 @@ class Stash extends Equatable { String toString() { return 'Stash{index: $index, message: $message, oid: $oid}'; } - - @override - List get props => [index, message, oid]; } diff --git a/lib/src/submodule.dart b/lib/src/submodule.dart index fd94785..c924eb7 100644 --- a/lib/src/submodule.dart +++ b/lib/src/submodule.dart @@ -1,12 +1,9 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/submodule.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Submodule extends Equatable { +class Submodule { /// Lookups submodule information by [name] or path (they are usually the /// same). /// @@ -270,23 +267,10 @@ class Submodule extends Equatable { @override String toString() { - return 'Submodule{name: $name, path: $path, url: $url, branch: $branch, ' - 'headOid: $headOid, indexOid: $indexOid, workdirOid: $workdirOid, ' - 'ignore: $ignore, updateRule: $updateRule}'; + return 'Submodule{name: $name, path: $path, url: $url, status: $status, ' + 'branch: $branch, headOid: $headOid, indexOid: $indexOid, ' + 'workdirOid: $workdirOid, ignore: $ignore, updateRule: $updateRule}'; } - - @override - List get props => [ - name, - path, - url, - branch, - headOid, - indexOid, - workdirOid, - ignore, - updateRule, - ]; } // coverage:ignore-start diff --git a/lib/src/tag.dart b/lib/src/tag.dart index 14965e8..8cddf8f 100644 --- a/lib/src/tag.dart +++ b/lib/src/tag.dart @@ -1,19 +1,15 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/object.dart' as object_bindings; import 'package:libgit2dart/src/bindings/tag.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Tag extends Equatable { +class Tag { /// Initializes a new instance of [Tag] class from provided pointer to /// tag object in memory. /// /// Note: For internal use. Use [Tag.lookup] instead. - @internal Tag(this._tagPointer) { _finalizer.attach(this, _tagPointer, detach: this); } @@ -209,7 +205,11 @@ class Tag extends Equatable { /// Tagger (author) of a tag if there is one. Signature? get tagger { final sigPointer = bindings.tagger(_tagPointer); - return sigPointer != nullptr ? Signature(sigPointer) : null; + if (sigPointer != nullptr) { + return Signature(sigPointer); + } else { + return null; + } } /// Releases memory allocated for tag object. @@ -223,9 +223,6 @@ class Tag extends Equatable { return 'Tag{oid: $oid, name: $name, message: $message, target: $target, ' 'tagger: $tagger}'; } - - @override - List get props => [name]; } // coverage:ignore-start diff --git a/lib/src/tree.dart b/lib/src/tree.dart index d3a479a..aa22c3e 100644 --- a/lib/src/tree.dart +++ b/lib/src/tree.dart @@ -1,18 +1,14 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/tree.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Tree extends Equatable { +class Tree { /// Initializes a new instance of [Tree] class from provided pointer to /// tree object in memory. /// /// Note: For internal use. Use [Tree.lookup] instead. - @internal Tree(this._treePointer) { _finalizer.attach(this, _treePointer, detach: this); } @@ -31,16 +27,24 @@ class Tree extends Equatable { /// Pointer to memory address for allocated tree object. /// /// Note: For internal use. - @internal Pointer get pointer => _treePointer; /// List with tree entries of a tree. List get entries { final entryCount = bindings.entryCount(_treePointer); - return [ - for (var i = 0; i < entryCount; i++) - TreeEntry(bindings.getByIndex(treePointer: _treePointer, index: i)) - ]; + final result = []; + for (var i = 0; i < entryCount; i++) { + result.add( + TreeEntry( + bindings.getByIndex( + treePointer: _treePointer, + index: i, + ), + ), + ); + } + + return result; } /// Lookups a tree entry in the tree. @@ -98,9 +102,6 @@ class Tree extends Equatable { String toString() { return 'Tree{oid: $oid, length: $length}'; } - - @override - List get props => [oid]; } // coverage:ignore-start @@ -109,14 +110,12 @@ final _finalizer = Finalizer>( ); // coverage:ignore-end -@immutable -class TreeEntry extends Equatable { +class TreeEntry { /// Initializes a new instance of [TreeEntry] class from provided pointer to /// tree entry object in memory. /// /// Note: For internal use. - @internal - const TreeEntry(this._treeEntryPointer); + TreeEntry(this._treeEntryPointer); /// Initializes a new instance of [TreeEntry] class from provided pointer to /// tree entry object in memory. @@ -151,9 +150,6 @@ class TreeEntry extends Equatable { @override String toString() => 'TreeEntry{oid: $oid, name: $name, filemode: $filemode}'; - - @override - List get props => [oid, name, filemode]; } // coverage:ignore-start diff --git a/lib/src/util.dart b/lib/src/util.dart index 3ba855c..afb5322 100644 --- a/lib/src/util.dart +++ b/lib/src/util.dart @@ -1,15 +1,14 @@ // coverage:ignore-file -import 'dart:convert'; import 'dart:ffi'; import 'dart:io'; +import 'package:cli_util/cli_logging.dart' show Ansi, Logger; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; -import 'package:libgit2dart/src/bindings/libgit2_opts_bindings.dart'; import 'package:path/path.dart' as path; -import 'package:pub_semver/pub_semver.dart'; +import 'package:pub_cache/pub_cache.dart'; -const libgit2Version = '1.5.0'; +const libgit2Version = '1.4.3'; final libDir = path.join('.dart_tool', 'libgit2'); String getLibName() { @@ -26,20 +25,6 @@ String getLibName() { return 'libgit2-$libgit2Version.$ext'; } -/// Returns location of the most recent verison of the libgit2dart package -/// contained in the cache. -String? checkCache() { - final cache = json.decode( - Process.runSync('dart', ['pub', 'cache', 'list']).stdout as String, - ) as Map; - final packages = cache['packages'] as Map; - final libPackages = packages['libgit2dart'] as Map?; - final versions = libPackages?.keys.map((e) => Version.parse(e)).toList(); - final latestVersion = libPackages?[Version.primary(versions!).toString()] - as Map?; - return latestVersion?['location'] as String?; -} - /// Checks if [File]/[Link] exists for [path]. bool _doesFileExist(String path) { return File(path).existsSync() || Link(path).existsSync(); @@ -47,8 +32,13 @@ bool _doesFileExist(String path) { /// Returns path to dynamic library if found. String? _resolveLibPath(String name) { + var libPath = path.join(Directory.current.path, name); + + // If lib is in Present Working Directory. + if (_doesFileExist(libPath)) return libPath; + // If lib is in Present Working Directory's '.dart_tool/libgit2/[platform]' folder. - var libPath = path.join( + libPath = path.join( Directory.current.path, libDir, Platform.operatingSystem, @@ -60,30 +50,22 @@ String? _resolveLibPath(String name) { libPath = path.join(Directory.current.path, Platform.operatingSystem, name); if (_doesFileExist(libPath)) return libPath; - // If lib is in executable's folder. - libPath = path.join(path.dirname(Platform.resolvedExecutable), name); - if (_doesFileExist(libPath)) return libPath; - - // If lib is in executable's bundled 'lib' folder. - libPath = path.join(path.dirname(Platform.resolvedExecutable), 'lib', name); - if (_doesFileExist(libPath)) return libPath; - - // If lib is installed in system dir. - if (Platform.isMacOS || Platform.isLinux) { - final paths = [ - '/usr/local/lib/libgit2.$libgit2Version.dylib', - '/usr/local/lib/libgit2.so.$libgit2Version', - '/usr/lib64/libgit2.so.$libgit2Version' - ]; - for (final path in paths) { - if (_doesFileExist(path)) return path; - } + String checkCache(PubCache pubCache) { + final pubCacheDir = + pubCache.getLatestVersion('libgit2dart')!.resolve()!.location; + return path.join(pubCacheDir.path, Platform.operatingSystem, name); } - // If lib is in '.pub_cache' folder. - final cachedLocation = checkCache(); - if (cachedLocation != null) { - libPath = path.join(cachedLocation, Platform.operatingSystem, name); + // If lib is in Dart's '.pub_cache' folder. + libPath = checkCache(PubCache()); + if (_doesFileExist(libPath)) return libPath; + + // If lib is in Flutter's '.pub_cache' folder. + final env = Platform.environment; + if (env.containsKey('FLUTTER_ROOT')) { + final flutterPubCache = + PubCache(Directory(path.join(env['FLUTTER_ROOT']!, '.pub-cache'))); + libPath = checkCache(flutterPubCache); if (_doesFileExist(libPath)) return libPath; } @@ -92,15 +74,26 @@ String? _resolveLibPath(String name) { DynamicLibrary loadLibrary(String name) { try { - return DynamicLibrary.open(_resolveLibPath(name) ?? name); - } catch (e) { - stderr.writeln( - 'Failed to open the library. Make sure that libgit2 library is bundled ' - 'with the application.', + return DynamicLibrary.open( + _resolveLibPath(name) ?? name, ); + } catch (e) { + final logger = Logger.standard(); + final ansi = Ansi(Ansi.terminalSupportsAnsi); + + logger.stderr( + '${ansi.red}Failed to open the library. Make sure that libgit2 ' + 'library is bundled with the application.${ansi.none}', + ); + logger.stdout(ansi.none); rethrow; } } final libgit2 = Libgit2(loadLibrary(getLibName())); -final libgit2Opts = Libgit2Opts(loadLibrary(getLibName())); + +bool isValidShaHex(String str) { + final hexRegExp = RegExp(r'^[0-9a-fA-F]+$'); + return hexRegExp.hasMatch(str) && + (GIT_OID_MINPREFIXLEN <= str.length && GIT_OID_HEXSZ >= str.length); +} diff --git a/lib/src/worktree.dart b/lib/src/worktree.dart index d78e7cc..bca7e3d 100644 --- a/lib/src/worktree.dart +++ b/lib/src/worktree.dart @@ -1,12 +1,9 @@ import 'dart:ffi'; -import 'package:equatable/equatable.dart'; import 'package:libgit2dart/libgit2dart.dart'; import 'package:libgit2dart/src/bindings/libgit2_bindings.dart'; import 'package:libgit2dart/src/bindings/worktree.dart' as bindings; -import 'package:meta/meta.dart'; -@immutable -class Worktree extends Equatable { +class Worktree { /// Creates new worktree. /// /// If [ref] is provided, no new branch will be created but specified [ref] @@ -77,15 +74,10 @@ class Worktree extends Equatable { /// Throws a [LibGit2Error] if error occured. bool get isPrunable => bindings.isPrunable(_worktreePointer); - /// Prunes working tree, that is removes the git data structures on disk. + /// Prunes working tree. /// - /// [flags] is optional combination of [GitWorktree] flags. - void prune([Set? flags]) { - bindings.prune( - worktreePointer: _worktreePointer, - flags: flags?.fold(0, (acc, e) => acc! | e.value), - ); - } + /// Prune the working tree, that is remove the git data structures on disk. + void prune() => bindings.prune(_worktreePointer); /// Whether worktree is valid. /// @@ -101,12 +93,8 @@ class Worktree extends Equatable { @override String toString() { - return 'Worktree{name: $name, path: $path, isLocked: $isLocked, ' - 'isPrunable: $isPrunable, isValid: $isValid}'; + return 'Worktree{name: $name, path: $path}'; } - - @override - List get props => [name, path, isLocked, isValid]; } // coverage:ignore-start diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 64d842a..325acb8 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -20,6 +20,6 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) # List of absolute paths to libraries that should be bundled with the plugin set(libgit2dart_bundled_libraries - "${CMAKE_CURRENT_SOURCE_DIR}/libgit2-1.5.0.so" + "${CMAKE_CURRENT_SOURCE_DIR}/libgit2-1.4.3.so" PARENT_SCOPE ) diff --git a/linux/libgit2-1.4.3.so b/linux/libgit2-1.4.3.so new file mode 100644 index 0000000..d5f1411 Binary files /dev/null and b/linux/libgit2-1.4.3.so differ diff --git a/linux/libgit2-1.5.0.so b/linux/libgit2-1.5.0.so deleted file mode 100644 index 77a2487..0000000 Binary files a/linux/libgit2-1.5.0.so and /dev/null differ diff --git a/macos/libgit2-1.4.3.dylib b/macos/libgit2-1.4.3.dylib new file mode 100644 index 0000000..28a0046 Binary files /dev/null and b/macos/libgit2-1.4.3.dylib differ diff --git a/macos/libgit2-1.5.0.dylib b/macos/libgit2-1.5.0.dylib deleted file mode 100644 index 105751d..0000000 Binary files a/macos/libgit2-1.5.0.dylib and /dev/null differ diff --git a/macos/libgit2dart.podspec b/macos/libgit2dart.podspec index 5ccfc67..b5c817b 100644 --- a/macos/libgit2dart.podspec +++ b/macos/libgit2dart.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'libgit2dart' - s.version = '1.2.2' + s.version = '1.0.0' s.summary = 'Dart bindings to libgit2.' s.description = <<-DESC Dart bindings to libgit2. @@ -15,7 +15,7 @@ Dart bindings to libgit2. s.source = { :path => '.' } s.source_files = 'Classes/**/*' s.dependency 'FlutterMacOS' - s.vendored_libraries = 'libgit2-1.5.0.dylib' + s.vendored_libraries = 'libgit2-1.4.3.dylib' s.platform = :osx, '10.11' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } diff --git a/pubspec.yaml b/pubspec.yaml index d0c47a5..2e585f9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,25 +1,25 @@ name: libgit2dart -description: Dart bindings to libgit2, provides ability to use libgit2 library in Dart and Flutter. +description: Dart bindings to libgit2. -version: 1.2.2 +version: 1.0.0 homepage: https://github.com/SkinnyMind/libgit2dart environment: - sdk: ">=2.18.0 <3.0.0" - flutter: ">=3.3.0" + sdk: ">=2.17.0 <3.0.0" + flutter: ">=2.13.0-0.0.pre.578" dependencies: args: ^2.3.0 - equatable: ^2.0.3 - ffi: ^2.0.0 + cli_util: ^0.3.5 + ffi: ^1.1.2 meta: ^1.7.0 path: ^1.8.1 - pub_semver: ^2.1.3 + pub_cache: ^0.3.1 dev_dependencies: - ffigen: ^6.0.1 + ffigen: ^4.1.2 lints: ^2.0.0 test: ^1.20.0 diff --git a/test/annotated_test.dart b/test/annotated_test.dart index 6a0545c..6ac8165 100644 --- a/test/annotated_test.dart +++ b/test/annotated_test.dart @@ -107,12 +107,5 @@ void main() { final annotated = AnnotatedCommit.lookup(repo: repo, oid: tip); expect(() => annotated.free(), returnsNormally); }); - - test('supports value comparison', () { - expect( - AnnotatedCommit.lookup(repo: repo, oid: tip), - equals(AnnotatedCommit.lookup(repo: repo, oid: tip)), - ); - }); }); } diff --git a/test/blame_test.dart b/test/blame_test.dart index bfe4e1e..123f99f 100644 --- a/test/blame_test.dart +++ b/test/blame_test.dart @@ -211,12 +211,5 @@ void main() { final blame = Blame.file(repo: repo, path: 'feature_file'); expect(blame.toString(), contains('BlameHunk{')); }); - - test('supports value comparison', () { - expect( - Blame.file(repo: repo, path: 'feature_file'), - equals(Blame.file(repo: repo, path: 'feature_file')), - ); - }); }); } diff --git a/test/blob_test.dart b/test/blob_test.dart index 73e9b27..c1d47a5 100644 --- a/test/blob_test.dart +++ b/test/blob_test.dart @@ -153,12 +153,5 @@ void main() { final blob = Blob.lookup(repo: repo, oid: repo[blobSHA]); expect(blob.toString(), contains('Blob{')); }); - - test('supports value comparison', () { - expect( - Blob.lookup(repo: repo, oid: repo[blobSHA]), - equals(Blob.lookup(repo: repo, oid: repo[blobSHA])), - ); - }); }); } diff --git a/test/branch_test.dart b/test/branch_test.dart index 9728c6b..7b60460 100644 --- a/test/branch_test.dart +++ b/test/branch_test.dart @@ -327,12 +327,5 @@ void main() { final branch = Branch.lookup(repo: repo, name: 'master'); expect(branch.toString(), contains('Branch{')); }); - - test('supports value comparison', () { - expect( - Branch.lookup(repo: repo, name: 'master'), - equals(Branch.lookup(repo: repo, name: 'master')), - ); - }); }); } diff --git a/test/commit_test.dart b/test/commit_test.dart index a68f9c0..bb735ab 100644 --- a/test/commit_test.dart +++ b/test/commit_test.dart @@ -67,109 +67,6 @@ void main() { expect(file.existsSync(), false); }); - test('reverts merge commit to provided parent', () { - const masterContents = 'master contents'; - final file = File(p.join(repo.workdir, 'another_feature_file')) - ..createSync() - ..writeAsStringSync(masterContents); - - repo.index.add('another_feature_file'); - repo.index.write(); - - // Creating commit on 'master' branch with file contents conflicting to - // 'feature' branch. - final masterTip = Commit.create( - repo: repo, - updateRef: 'HEAD', - message: 'master commit\n', - author: author, - committer: committer, - tree: Tree.lookup(repo: repo, oid: repo.index.writeTree()), - parents: [Commit.lookup(repo: repo, oid: repo.head.target)], - ); - - // Switching to 'feature' branch. - Checkout.reference(repo: repo, name: 'refs/heads/feature'); - repo.setHead('refs/heads/feature'); - - file.writeAsStringSync('feature contents'); - - repo.index.add('another_feature_file'); - repo.index.write(); - - // Creating commit on 'feature' branch with file contents conflicting to - // 'master' branch. - final featureTip = Commit.create( - repo: repo, - updateRef: 'HEAD', - message: 'feature commit\n', - author: author, - committer: committer, - tree: Tree.lookup(repo: repo, oid: repo.index.writeTree()), - parents: [Commit.lookup(repo: repo, oid: repo.head.target)], - ); - - // Merging master branch. - Merge.commit( - repo: repo, - commit: AnnotatedCommit.lookup( - repo: repo, - oid: Oid.fromSHA(repo: repo, sha: masterTip.sha), - ), - ); - - expect(repo.index.hasConflicts, true); - - // "Resolving" conflict. - repo.index.updateAll(['another_feature_file']); - repo.index.write(); - repo.stateCleanup(); - - // Creating merge commit. - final mergeOid = Commit.create( - repo: repo, - updateRef: 'HEAD', - message: 'merge commit\n', - author: author, - committer: committer, - tree: Tree.lookup(repo: repo, oid: repo.index.writeTree()), - parents: [ - Commit.lookup(repo: repo, oid: featureTip), - Commit.lookup(repo: repo, oid: masterTip), - ], - ); - - final mergeCommit = Commit.lookup(repo: repo, oid: mergeOid); - mergeCommit.revert(mainline: 2); - - expect(file.readAsStringSync(), masterContents); - }); - - test('reverts commit with provided merge options and checkout options', () { - final commit = Commit.lookup(repo: repo, oid: repo['821ed6e']); - final file = File(p.join(repo.workdir, 'dir', 'dir_file.txt')); - expect(repo.index.find('dir/dir_file.txt'), true); - expect(file.existsSync(), true); - - commit.revert( - mergeFavor: GitMergeFileFavor.ours, - mergeFlags: {GitMergeFlag.noRecursive, GitMergeFlag.skipREUC}, - mergeFileFlags: { - GitMergeFileFlag.ignoreWhitespace, - GitMergeFileFlag.styleZdiff3 - }, - checkoutStrategy: { - GitCheckout.force, - GitCheckout.conflictStyleMerge, - }, - checkoutDirectory: repo.workdir, - checkoutPaths: ['dir/dir_file.txt'], - ); - - expect(repo.index.find('dir/dir_file.txt'), false); - expect(file.existsSync(), false); - }); - test('throws when trying to revert and error occurs', () { expect(() => Commit(nullptr).revert(), throwsA(isA())); }); @@ -187,25 +84,6 @@ void main() { expect(file.existsSync(), true); }); - test('reverts commit to provided commit with provided merge options', () { - final file = File(p.join(repo.workdir, 'dir', 'dir_file.txt')); - expect(repo.index.find('dir/dir_file.txt'), true); - expect(file.existsSync(), true); - - final from = Commit.lookup(repo: repo, oid: repo['821ed6e']); - final revertIndex = from.revertTo( - commit: Commit.lookup(repo: repo, oid: repo['78b8bf1']), - mergeFavor: GitMergeFileFavor.ours, - mergeFlags: {GitMergeFlag.noRecursive, GitMergeFlag.skipREUC}, - mergeFileFlags: { - GitMergeFileFlag.ignoreWhitespace, - GitMergeFileFlag.styleZdiff3 - }, - ); - expect(revertIndex.find('dir/dir_file.txt'), false); - expect(file.existsSync(), true); - }); - test('throws when trying to revert commit and error occurs', () { final nullCommit = Commit(nullptr); expect( @@ -518,12 +396,5 @@ Some description. final commit = Commit.lookup(repo: repo, oid: tip); expect(commit.toString(), contains('Commit{')); }); - - test('supports value comparison', () { - expect( - Commit.lookup(repo: repo, oid: tip), - equals(Commit.lookup(repo: repo, oid: tip)), - ); - }); }); } diff --git a/test/config_test.dart b/test/config_test.dart index 4f6047b..b14a8b7 100644 --- a/test/config_test.dart +++ b/test/config_test.dart @@ -217,9 +217,5 @@ void main() { final entry = config.first; expect(entry.toString(), contains('ConfigEntry{')); }); - - test('supports value comparison', () { - expect(Config.open(filePath), equals(Config.open(filePath))); - }); }); } diff --git a/test/credentials_test.dart b/test/credentials_test.dart index f198093..cdfaa1c 100644 --- a/test/credentials_test.dart +++ b/test/credentials_test.dart @@ -83,28 +83,32 @@ void main() { cloneDir.deleteSync(recursive: true); }); - test('clones repository with provided keypair', () { - final cloneDir = Directory.systemTemp.createTempSync('clone'); - final keypair = Keypair( - username: 'git', - pubKey: p.join('test', 'assets', 'keys', 'id_rsa.pub'), - privateKey: p.join('test', 'assets', 'keys', 'id_rsa'), - passPhrase: 'empty', - ); - final callbacks = Callbacks(credentials: keypair); + test( + testOn: '!linux', + 'clones repository with provided keypair', + () { + final cloneDir = Directory.systemTemp.createTempSync('clone'); + final keypair = Keypair( + username: 'git', + pubKey: p.join('test', 'assets', 'keys', 'id_rsa.pub'), + privateKey: p.join('test', 'assets', 'keys', 'id_rsa'), + passPhrase: 'empty', + ); + final callbacks = Callbacks(credentials: keypair); - final repo = Repository.clone( - url: 'ssh://git@github.com/libgit2/TestGitRepository', - localPath: cloneDir.path, - callbacks: callbacks, - ); + final repo = Repository.clone( + url: 'ssh://git@github.com/libgit2/TestGitRepository', + localPath: cloneDir.path, + callbacks: callbacks, + ); - expect(repo.isEmpty, false); + expect(repo.isEmpty, false); - if (Platform.isLinux || Platform.isMacOS) { - cloneDir.deleteSync(recursive: true); - } - }); + if (Platform.isLinux || Platform.isMacOS) { + cloneDir.deleteSync(recursive: true); + } + }, + ); test('throws when no credentials is provided', () { final cloneDir = Directory.systemTemp.createTempSync('clone'); @@ -185,32 +189,36 @@ void main() { cloneDir.deleteSync(recursive: true); }); - test('clones repository with provided keypair from memory', () { - final cloneDir = Directory.systemTemp.createTempSync('clone'); - final pubKey = File(p.join('test', 'assets', 'keys', 'id_rsa.pub')) - .readAsStringSync(); - final privateKey = - File(p.join('test', 'assets', 'keys', 'id_rsa')).readAsStringSync(); - final keypair = KeypairFromMemory( - username: 'git', - pubKey: pubKey, - privateKey: privateKey, - passPhrase: 'empty', - ); - final callbacks = Callbacks(credentials: keypair); + test( + testOn: '!linux', + 'clones repository with provided keypair from memory', + () { + final cloneDir = Directory.systemTemp.createTempSync('clone'); + final pubKey = File(p.join('test', 'assets', 'keys', 'id_rsa.pub')) + .readAsStringSync(); + final privateKey = + File(p.join('test', 'assets', 'keys', 'id_rsa')).readAsStringSync(); + final keypair = KeypairFromMemory( + username: 'git', + pubKey: pubKey, + privateKey: privateKey, + passPhrase: 'empty', + ); + final callbacks = Callbacks(credentials: keypair); - final repo = Repository.clone( - url: 'ssh://git@github.com/libgit2/TestGitRepository', - localPath: cloneDir.path, - callbacks: callbacks, - ); + final repo = Repository.clone( + url: 'ssh://git@github.com/libgit2/TestGitRepository', + localPath: cloneDir.path, + callbacks: callbacks, + ); - expect(repo.isEmpty, false); + expect(repo.isEmpty, false); - if (Platform.isLinux || Platform.isMacOS) { - cloneDir.deleteSync(recursive: true); - } - }); + if (Platform.isLinux || Platform.isMacOS) { + cloneDir.deleteSync(recursive: true); + } + }, + ); test('throws when provided keypair from memory is incorrect', () { final cloneDir = Directory.systemTemp.createTempSync('clone'); diff --git a/test/diff_test.dart b/test/diff_test.dart index 5c21bb6..1135c5e 100644 --- a/test/diff_test.dart +++ b/test/diff_test.dart @@ -580,15 +580,5 @@ index e69de29..c217c63 100644 expect(patch.delta.oldFile.toString(), contains('DiffFile{')); expect(stats.toString(), contains('DiffStats{')); }); - - test('supports value comparison', () { - expect(Diff.parse(patchText), equals(Diff.parse(patchText))); - - final diff = Diff.parse(patchText); - expect(diff.deltas[0], equals(diff.deltas[0])); - - final delta = diff.deltas[0]; - expect(delta.oldFile, equals(delta.oldFile)); - }); }); } diff --git a/test/git_types_test.dart b/test/git_types_test.dart index 68ef591..c0d81e9 100644 --- a/test/git_types_test.dart +++ b/test/git_types_test.dart @@ -551,25 +551,4 @@ void main() { expect(actual, expected); }); }); - - test('GitIndexAddOption returns correct values', () { - const expected = { - GitIndexAddOption.defaults: 0, - GitIndexAddOption.force: 1, - GitIndexAddOption.disablePathspecMatch: 2, - GitIndexAddOption.checkPathspec: 4, - }; - final actual = {for (final e in GitIndexAddOption.values) e: e.value}; - expect(actual, expected); - }); - - test('GitWorktree returns correct values', () { - const expected = { - GitWorktree.pruneValid: 1, - GitWorktree.pruneLocked: 2, - GitWorktree.pruneWorkingTree: 4, - }; - final actual = {for (final e in GitWorktree.values) e: e.value}; - expect(actual, expected); - }); } diff --git a/test/index_test.dart b/test/index_test.dart index a681ad4..9a848e4 100644 --- a/test/index_test.dart +++ b/test/index_test.dart @@ -175,10 +175,7 @@ void main() { group('addAll()', () { test('adds with provided pathspec', () { index.clear(); - index.addAll( - ['file', 'feature_file'], - flags: {GitIndexAddOption.checkPathspec, GitIndexAddOption.force}, - ); + index.addAll(['file', 'feature_file']); expect(index.length, 2); expect(index['file'].oid.sha, fileSha); @@ -512,9 +509,5 @@ void main() { expect(index.toString(), contains('Index{')); expect(index['file'].toString(), contains('IndexEntry{')); }); - - test('supports value comparison', () { - expect(repo.index, equals(repo.index)); - }); }); } diff --git a/test/libgit2_test.dart b/test/libgit2_test.dart index 0e42630..744c280 100644 --- a/test/libgit2_test.dart +++ b/test/libgit2_test.dart @@ -20,202 +20,10 @@ void main() { 'directories', () { final oldValue = Libgit2.ownerValidation; Libgit2.ownerValidation = !oldValue; - expect(Libgit2.ownerValidation, isNot(oldValue)); + expect(Libgit2.ownerValidation, equals(!oldValue)); - // Reset to avoid side effects in later tests + // Set it back Libgit2.ownerValidation = oldValue; }); - - test('sets and returns the maximum mmap window size', () { - final oldValue = Libgit2.mmapWindowSize; - Libgit2.mmapWindowSize = 420 * 1024; - expect(Libgit2.mmapWindowSize, isNot(oldValue)); - - // Reset to avoid side effects in later tests - Libgit2.mmapWindowSize = oldValue; - }); - - test( - 'sets and returns the maximum memory that will be mapped in total by ' - 'the library', () { - final oldValue = Libgit2.mmapWindowMappedLimit; - Libgit2.mmapWindowMappedLimit = 420 * 1024; - expect(Libgit2.mmapWindowMappedLimit, isNot(oldValue)); - - // Reset to avoid side effects in later tests - Libgit2.mmapWindowMappedLimit = oldValue; - }); - - test( - 'sets and returns the maximum number of files that will be mapped ' - 'at any time by the library', () { - final oldValue = Libgit2.mmapWindowFileLimit; - Libgit2.mmapWindowFileLimit = 69; - expect(Libgit2.mmapWindowFileLimit, isNot(oldValue)); - - // Reset to avoid side effects in later tests - Libgit2.mmapWindowFileLimit = oldValue; - }); - - test('sets and returns the search path for a given level of config data', - () { - const paths = '/tmp/global:/tmp/another'; - Libgit2.setConfigSearchPath(level: GitConfigLevel.global, path: paths); - expect(Libgit2.getConfigSearchPath(GitConfigLevel.global), paths); - - // Reset to avoid side effects in later tests - Libgit2.setConfigSearchPath(level: GitConfigLevel.global, path: null); - }); - - test( - 'sets the maximum data size for the given type of object ' - 'to be considered eligible for caching in memory', () { - expect( - () => Libgit2.setCacheObjectLimit(type: GitObject.blob, value: 420), - returnsNormally, - ); - - // Reset to avoid side effects in later tests - Libgit2.setCacheObjectLimit(type: GitObject.blob, value: 0); - }); - - test('sets the maximum cache size', () { - expect(Libgit2.cachedMemory.allowed, 256 * (1024 * 1024)); - - Libgit2.setCacheMaxSize(128 * (1024 * 1024)); - - expect(Libgit2.cachedMemory.allowed, 128 * (1024 * 1024)); - - // Reset to avoid side effects in later tests - Libgit2.setCacheMaxSize(256 * (1024 * 1024)); - }); - - test('returns CachedMemory object', () { - expect(Libgit2.cachedMemory.allowed, 256 * (1024 * 1024)); - expect(Libgit2.cachedMemory.toString(), contains('CachedMemory{')); - }); - - test('disables and enables caching', () { - expect(() => Libgit2.disableCaching(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enableCaching(); - }); - - test('sets and returns the default template path', () { - final oldValue = Libgit2.templatePath; - Libgit2.templatePath = '/tmp/template'; - expect(Libgit2.templatePath, isNot(oldValue)); - - // Reset to avoid side effects in later tests - Libgit2.templatePath = oldValue; - }); - - test('sets location for ssl certificates', () { - expect( - () => Libgit2.setSSLCertLocations(file: 'etc/ssl/cert.pem'), - returnsNormally, - ); - expect( - () => Libgit2.setSSLCertLocations(path: 'etc/ssl/certs/'), - returnsNormally, - ); - }); - - test('throws when trying to set both ssl certificates location to null', - () { - expect( - () => Libgit2.setSSLCertLocations(), - throwsA(isA()), - ); - }); - - test('sets and returns the User-Agent header', () { - final oldValue = Libgit2.userAgent; - Libgit2.userAgent = 'Mozilla/5.0'; - expect(Libgit2.userAgent, isNot(oldValue)); - - // Reset to avoid side effects in later tests - Libgit2.userAgent = oldValue; - }); - - test('disables and enables strict object creation', () { - expect(() => Libgit2.disableStrictObjectCreation(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enableStrictObjectCreation(); - }); - - test('disables and enables strict symbolic reference creation', () { - expect(() => Libgit2.disableStrictSymbolicRefCreation(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enableStrictSymbolicRefCreation(); - }); - - test( - 'disables and enables the use of offset deltas when creating packfiles', - () { - expect(() => Libgit2.disableOffsetDelta(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enableOffsetDelta(); - }); - - test('enables and disables the fsync of files in gitdir', () { - expect(() => Libgit2.enableFsyncGitdir(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.disableFsyncGitdir(); - }); - - test('disables and enables strict hash verification', () { - expect(() => Libgit2.disableStrictHashVerification(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enableStrictHashVerification(); - }); - - test('disables and enables check for unsaved changes in index', () { - expect(() => Libgit2.disableUnsavedIndexSafety(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enableUnsavedIndexSafety(); - }); - - test('sets and returns the pack maximum objects', () { - final oldValue = Libgit2.packMaxObjects; - Libgit2.packMaxObjects = 69; - expect(Libgit2.packMaxObjects, isNot(oldValue)); - - // Reset to avoid side effects in later tests - Libgit2.packMaxObjects = oldValue; - }); - - test('disables and enables check for unsaved changes in index', () { - expect(() => Libgit2.disablePackKeepFileChecks(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enablePackKeepFileChecks(); - }); - - test( - 'disables and enables check for unsaved changes in index', - testOn: '!windows', - () { - expect(() => Libgit2.disableHttpExpectContinue(), returnsNormally); - - // Reset to avoid side effects in later tests - Libgit2.enableHttpExpectContinue(); - }, - ); - - test('sets and returns the list of git extensions', () { - Libgit2.extensions = ['newext', 'anotherext']; - expect(Libgit2.extensions, ['noop', 'newext', 'anotherext']); - - // Reset to avoid side effects in later tests - Libgit2.extensions = ['!newext', '!anotherext']; - }); }); } diff --git a/test/merge_test.dart b/test/merge_test.dart index 4b35d29..6f3a276 100644 --- a/test/merge_test.dart +++ b/test/merge_test.dart @@ -168,38 +168,31 @@ Another feature edit expect(diff, diffExpected); }); - test('merges with provided options', () { + test('merges with provided merge flags and file flags', () { const diffExpected = """ -\<<<<<<< ours -Feature edit on feature branch -||||||| ancestor -Feature edit +\<<<<<<< conflict_file +master conflict edit ======= -Another feature edit ->>>>>>> theirs +conflict branch edit +>>>>>>> conflict_file """; - Checkout.reference(repo: repo, name: 'refs/heads/feature'); - repo.setHead('refs/heads/feature'); - Merge.commit( repo: repo, commit: AnnotatedCommit.lookup( repo: repo, - oid: Branch.lookup(repo: repo, name: 'ancestor-conflict').target, + oid: Branch.lookup(repo: repo, name: 'conflict-branch').target, ), + mergeFlags: {GitMergeFlag.noRecursive}, + fileFlags: {GitMergeFileFlag.ignoreWhitespaceEOL}, ); - final conflictedFile = repo.index.conflicts['feature_file']!; + final conflictedFile = repo.index.conflicts['conflict_file']!; final diff = Merge.fileFromIndex( repo: repo, - ancestor: conflictedFile.ancestor, - ancestorLabel: 'ancestor', + ancestor: null, ours: conflictedFile.our!, - oursLabel: 'ours', theirs: conflictedFile.their!, - theirsLabel: 'theirs', - flags: {GitMergeFileFlag.styleDiff3}, ); expect(diff, diffExpected); diff --git a/test/note_test.dart b/test/note_test.dart index 63d82ee..f2923ee 100644 --- a/test/note_test.dart +++ b/test/note_test.dart @@ -134,13 +134,5 @@ void main() { final note = Note.lookup(repo: repo, annotatedOid: repo['821ed6e']); expect(note.toString(), contains('Note{')); }); - - test('supports value comparison', () { - final oid = repo.head.target; - expect( - Note.lookup(repo: repo, annotatedOid: oid), - equals(Note.lookup(repo: repo, annotatedOid: oid)), - ); - }); }); } diff --git a/test/odb_test.dart b/test/odb_test.dart index de44bac..18ffcfd 100644 --- a/test/odb_test.dart +++ b/test/odb_test.dart @@ -50,7 +50,6 @@ void main() { expect(object.type, GitObject.blob); expect(object.data, blobContent); expect(object.size, 13); - expect(object, equals(repo.odb.read(repo[blobSha]))); }); test('throws when trying to read object and error occurs', () { @@ -116,9 +115,5 @@ void main() { final object = repo.odb.read(repo[blobSha]); expect(object.toString(), contains('OdbObject{')); }); - - test('supports value comparison', () { - expect(repo.odb, equals(repo.odb)); - }); }); } diff --git a/test/patch_test.dart b/test/patch_test.dart index 8e791d1..055f89d 100644 --- a/test/patch_test.dart +++ b/test/patch_test.dart @@ -230,25 +230,5 @@ index e69de29..0000000 expect(patch.hunks[0].toString(), contains('DiffHunk{')); expect(patch.hunks[0].lines[0].toString(), contains('DiffLine{')); }); - - test('supports value comparison', () { - final patch = Patch.fromBuffers( - oldBuffer: oldBuffer, - newBuffer: newBuffer, - oldBufferPath: path, - newBufferPath: path, - ); - final anotherPatch = Patch.fromBuffers( - oldBuffer: oldBuffer, - newBuffer: newBuffer, - oldBufferPath: path, - newBufferPath: path, - ); - expect(patch, equals(anotherPatch)); - expect(patch.hunks[0], equals(patch.hunks[0])); - - final hunk = patch.hunks[0]; - expect(hunk.lines[0], equals(hunk.lines[0])); - }); }); } diff --git a/test/reference_test.dart b/test/reference_test.dart index 7b74b87..8c485da 100644 --- a/test/reference_test.dart +++ b/test/reference_test.dart @@ -155,7 +155,7 @@ void main() { final duplicate = ref.duplicate(); expect(repo.references.length, 6); - expect(duplicate, equals(ref)); + expect(duplicate.equals(ref), true); }); group('create direct', () { @@ -354,35 +354,25 @@ void main() { group('set target', () { test('sets direct reference with provided oid target', () { - Reference.setTarget( - repo: repo, - name: 'refs/heads/master', - target: repo[newCommit], - ); final ref = Reference.lookup(repo: repo, name: 'refs/heads/master'); + ref.setTarget(target: repo[newCommit]); expect(ref.target.sha, newCommit); }); test('sets symbolic target with provided reference name', () { - Reference.setTarget( - repo: repo, - name: 'HEAD', - target: 'refs/heads/feature', - ); final ref = Reference.lookup(repo: repo, name: 'HEAD'); + expect(ref.target.sha, lastCommit); + + ref.setTarget(target: 'refs/heads/feature'); expect(ref.target.sha, '5aecfa0fb97eadaac050ccb99f03c3fb65460ad4'); }); test('sets target with log message', () { - repo.setIdentity(name: 'name', email: 'email'); - Reference.setTarget( - repo: repo, - name: 'HEAD', - target: 'refs/heads/feature', - logMessage: 'log message', - ); - final ref = Reference.lookup(repo: repo, name: 'HEAD'); + expect(ref.target.sha, lastCommit); + + repo.setIdentity(name: 'name', email: 'email'); + ref.setTarget(target: 'refs/heads/feature', logMessage: 'log message'); expect(ref.target.sha, '5aecfa0fb97eadaac050ccb99f03c3fb65460ad4'); final logEntry = ref.log.first; expect(logEntry.message, 'log message'); @@ -391,28 +381,18 @@ void main() { }); test('throws on invalid target', () { + final ref = Reference.lookup(repo: repo, name: 'HEAD'); expect( - () => Reference.setTarget( - repo: repo, - name: 'HEAD', - target: 'refs/heads/invalid~', - ), + () => ref.setTarget(target: 'refs/heads/invalid~'), throwsA(isA()), ); expect( - () => Reference.setTarget( - repo: repo, - name: 'HEAD', - target: Oid(nullptr), - ), + () => ref.setTarget(target: Oid(nullptr)), throwsA(isA()), ); - expect( - () => Reference.setTarget(repo: repo, name: 'HEAD', target: 0), - throwsA(isA()), - ); + expect(() => ref.setTarget(target: 0), throwsA(isA())); }); }); @@ -478,6 +458,17 @@ void main() { }); }); + test('checks equality', () { + final ref1 = Reference.lookup(repo: repo, name: 'refs/heads/master'); + final ref2 = Reference.lookup(repo: repo, name: 'refs/heads/master'); + final ref3 = Reference.lookup(repo: repo, name: 'refs/heads/feature'); + + expect(ref1.equals(ref2), true); + expect(ref1.notEquals(ref2), false); + expect(ref1.equals(ref3), false); + expect(ref1.notEquals(ref3), true); + }); + test('peels to non-tag object when no type is provided', () { final ref = Reference.lookup(repo: repo, name: 'refs/heads/master'); final commit = Commit.lookup(repo: repo, oid: ref.target); @@ -539,12 +530,5 @@ void main() { final ref = Reference.lookup(repo: repo, name: 'refs/heads/master'); expect(ref.toString(), contains('Reference{')); }); - - test('supports value comparison', () { - expect( - Reference.lookup(repo: repo, name: 'HEAD'), - equals(Reference.lookup(repo: repo, name: 'refs/heads/master')), - ); - }); }); } diff --git a/test/reflog_test.dart b/test/reflog_test.dart index a37f2ac..9bbea43 100644 --- a/test/reflog_test.dart +++ b/test/reflog_test.dart @@ -153,10 +153,5 @@ void main() { test('returns string representation of RefLogEntry object', () { expect(reflog[0].toString(), contains('RefLogEntry{')); }); - - test('supports value comparison', () { - final ref = Reference.lookup(repo: repo, name: 'refs/heads/master'); - expect(RefLog(repo.head), equals(RefLog(ref))); - }); }); } diff --git a/test/remote_test.dart b/test/remote_test.dart index caa3a63..07e7c34 100644 --- a/test/remote_test.dart +++ b/test/remote_test.dart @@ -33,7 +33,6 @@ void main() { expect(remote.url, remoteUrl); expect(remote.pushUrl, ''); expect(remote.toString(), contains('Remote{')); - expect(remote, equals(Remote.lookup(repo: repo, name: 'origin'))); }); test('throws when provided name for lookup is not found', () { @@ -43,13 +42,6 @@ void main() { ); }); - test('throws when trying to create remote and name already exists', () { - expect( - () => Remote.create(repo: repo, name: 'origin', url: remoteUrl), - throwsA(isA()), - ); - }); - test('creates without fetchspec', () { final remote = Remote.create( repo: repo, @@ -196,8 +188,6 @@ void main() { refspec.rTransform('refs/remotes/origin/master'), 'refs/heads/master', ); - - expect(refspec, equals(remote.getRefspec(0))); }); test('throws when trying to transform refspec with invalid reference name', @@ -278,9 +268,8 @@ void main() { expect(refs.first.localId, null); expect(refs.first.name, 'HEAD'); expect(refs.first.symRef, 'refs/heads/master'); - expect(refs.first.oid.sha, '49322bb17d3acc9146f98c97d078513228bbf3c0'); + expect((refs.first.oid).sha, '49322bb17d3acc9146f98c97d078513228bbf3c0'); expect(refs.first.toString(), contains('RemoteReference{')); - expect(refs.first, remote.ls().first); }); test( diff --git a/test/repository_empty_test.dart b/test/repository_empty_test.dart index 21aecdb..7375895 100644 --- a/test/repository_empty_test.dart +++ b/test/repository_empty_test.dart @@ -85,7 +85,6 @@ void main() { final identity = repo.identity; expect(identity.name, 'name'); expect(identity.email, 'email@email.com'); - expect(identity, equals(repo.identity)); }); test('unsets identity', () { diff --git a/test/repository_test.dart b/test/repository_test.dart index 7d155c3..34e0a25 100644 --- a/test/repository_test.dart +++ b/test/repository_test.dart @@ -249,9 +249,5 @@ void main() { test('returns string representation of Repository object', () { expect(repo.toString(), contains('Repository{')); }); - - test('supports value comparison', () { - expect(repo, equals(Repository.open(tmpDir.path))); - }); }); } diff --git a/test/reset_test.dart b/test/reset_test.dart index f5dd62e..2e477cb 100644 --- a/test/reset_test.dart +++ b/test/reset_test.dart @@ -50,34 +50,6 @@ void main() { expect(diff.deltas.length, 1); }); - test('resets with provided checkout options', () { - expect(file.readAsStringSync(), 'Feature edit\n'); - - repo.reset( - oid: repo[sha], - resetType: GitReset.hard, - strategy: {GitCheckout.conflictStyleZdiff3}, - pathspec: ['feature_file'], - ); - - expect(file.readAsStringSync(), isEmpty); - }); - - test( - 'throws when trying to reset and error occurs', - testOn: '!windows', - () { - expect( - () => repo.reset( - oid: repo[sha], - resetType: GitReset.hard, - checkoutDirectory: '', - ), - throwsA(isA()), - ); - }, - ); - group('resetDefault', () { test('updates entry in the index', () { file.writeAsStringSync('new edit'); @@ -89,17 +61,6 @@ void main() { expect(repo.status['feature_file'], {GitStatus.wtModified}); }); - test('removes entry in the index when null oid is provided', () { - const fileName = 'new_file.txt'; - File(p.join(tmpDir.path, fileName)).createSync(); - - repo.index.add(fileName); - expect(repo.status[fileName], {GitStatus.indexNew}); - - repo.resetDefault(oid: null, pathspec: [fileName]); - expect(repo.status[fileName], {GitStatus.wtNew}); - }); - test('throws when pathspec list is empty', () { expect( () => repo.resetDefault(oid: repo.head.target, pathspec: []), diff --git a/test/revparse_test.dart b/test/revparse_test.dart index 398e23b..78821f5 100644 --- a/test/revparse_test.dart +++ b/test/revparse_test.dart @@ -59,7 +59,7 @@ void main() { var headParse = RevParse.ext(repo: repo, spec: 'master'); expect(headParse.object.oid.sha, headSHA); - expect(headParse.reference, equals(masterRef)); + expect(headParse.reference?.equals(masterRef), true); expect(headParse.toString(), contains('RevParse{')); final featureRef = Reference.lookup( @@ -72,7 +72,7 @@ void main() { headParse.object.oid.sha, '5aecfa0fb97eadaac050ccb99f03c3fb65460ad4', ); - expect(headParse.reference, equals(featureRef)); + expect(headParse.reference?.equals(featureRef), true); }); test('.ext() returns only commit when no intermidiate reference found', () { diff --git a/test/revwalk_test.dart b/test/revwalk_test.dart index 5b3c9a0..e491ab0 100644 --- a/test/revwalk_test.dart +++ b/test/revwalk_test.dart @@ -50,16 +50,6 @@ void main() { } }); - test('walks only number of commits provided with limit', () { - final walker = RevWalk(repo); - - walker.push(repo[log.first]); - final commits = walker.walk(limit: 1); - - expect(commits.length, 1); - expect(commits[0].oid.sha, log[0]); - }); - test('returns list of commits with reverse sorting', () { final walker = RevWalk(repo); diff --git a/test/signature_test.dart b/test/signature_test.dart index c7e07c5..303a607 100644 --- a/test/signature_test.dart +++ b/test/signature_test.dart @@ -47,7 +47,6 @@ void main() { lessThan(5), ); expect(sig.offset, isA()); - expect(sig.sign, isNotEmpty); }); test('returns correct values', () { @@ -78,12 +77,5 @@ void main() { test('returns string representation of Signature object', () { expect(signature.toString(), contains('Signature{')); }); - - test('supports value comparison', () { - expect( - Signature.create(name: name, email: email, time: time), - equals(Signature.create(name: name, email: email, time: time)), - ); - }); }); } diff --git a/test/stash_test.dart b/test/stash_test.dart index a3d089c..6f811bc 100644 --- a/test/stash_test.dart +++ b/test/stash_test.dart @@ -211,12 +211,5 @@ void main() { expect(repo.stashes[0].toString(), contains('Stash{')); }); - - test('supports value comparison', () { - File(filePath).writeAsStringSync('edit', mode: FileMode.append); - Stash.create(repo: repo, stasher: stasher, message: 'WIP'); - - expect(repo.stashes.first, equals(repo.stashes.first)); - }); }); } diff --git a/test/submodule_test.dart b/test/submodule_test.dart index 972ac08..411ee36 100644 --- a/test/submodule_test.dart +++ b/test/submodule_test.dart @@ -243,12 +243,5 @@ void main() { final submodule = Submodule.lookup(repo: repo, name: testSubmodule); expect(() => submodule.free(), returnsNormally); }); - - test('supports value comparison', () { - expect( - Submodule.lookup(repo: repo, name: testSubmodule), - equals(Submodule.lookup(repo: repo, name: testSubmodule)), - ); - }); }); } diff --git a/test/tag_test.dart b/test/tag_test.dart index af9eb74..15a7b33 100644 --- a/test/tag_test.dart +++ b/test/tag_test.dart @@ -384,12 +384,5 @@ void main() { tag = Tag.lookup(repo: repo, oid: tagOid); expect(() => tag.free(), returnsNormally); }); - - test('supports value comparison', () { - expect( - Tag.lookup(repo: repo, oid: tagOid), - equals(Tag.lookup(repo: repo, oid: tagOid)), - ); - }); }); } diff --git a/test/tree_test.dart b/test/tree_test.dart index 7e27b06..e405c26 100644 --- a/test/tree_test.dart +++ b/test/tree_test.dart @@ -101,14 +101,5 @@ void main() { 'looked up by path', () { expect(() => tree['dir/dir_file.txt'].free(), returnsNormally); }); - - test('supports value comparison', () { - expect( - Tree.lookup(repo: repo, oid: repo['a8ae3dd']), - equals(Tree.lookup(repo: repo, oid: repo['a8ae3dd'])), - ); - - expect(tree[0], equals(tree[0])); - }); }); } diff --git a/test/worktree_test.dart b/test/worktree_test.dart index 550cf33..0ff6cd9 100644 --- a/test/worktree_test.dart +++ b/test/worktree_test.dart @@ -151,22 +151,6 @@ void main() { expect(repo.worktrees, []); }); - test('prunes worktree with provided flags', () { - expect(repo.worktrees, []); - - final worktree = Worktree.create( - repo: repo, - name: worktreeName, - path: worktreeDir.path, - ); - expect(repo.worktrees, [worktreeName]); - expect(worktree.isPrunable, false); - expect(worktree.isValid, true); - - worktree.prune({GitWorktree.pruneValid}); - expect(repo.worktrees, []); - }); - test('throws when trying get list of worktrees and error occurs', () { expect( () => Worktree.list(Repository(nullptr)), @@ -182,14 +166,5 @@ void main() { ); expect(() => worktree.free(), returnsNormally); }); - - test('supports value comparison', () { - final worktree = Worktree.create( - repo: repo, - name: worktreeName, - path: worktreeDir.path, - ); - expect(worktree, equals(Worktree.lookup(repo: repo, name: worktreeName))); - }); }); } diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 128c67f..a653c8a 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -19,6 +19,6 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) # List of absolute paths to libraries that should be bundled with the plugin set(libgit2dart_bundled_libraries - "${CMAKE_CURRENT_SOURCE_DIR}/libgit2-1.5.0.dll" + "${CMAKE_CURRENT_SOURCE_DIR}/libgit2-1.4.3.dll" PARENT_SCOPE ) diff --git a/windows/libgit2-1.5.0.dll b/windows/libgit2-1.4.3.dll similarity index 57% rename from windows/libgit2-1.5.0.dll rename to windows/libgit2-1.4.3.dll index 3c7347b..19ad281 100644 Binary files a/windows/libgit2-1.5.0.dll and b/windows/libgit2-1.4.3.dll differ