feat: upgrade libgit2 to 1.4.0 (#45)

This commit is contained in:
Aleksey Kulikov 2022-02-16 16:57:52 +03:00 committed by GitHub
parent 7a067beeb9
commit d901d2e13f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 747 additions and 287 deletions

File diff suppressed because it is too large Load diff

View file

@ -143,12 +143,13 @@ int writtenCount(Pointer<git_packbuilder> pb) {
return libgit2.git_packbuilder_written(pb);
}
/// Get the packfile's hash.
/// Get the unique name for the resulting packfile.
///
/// A packfile's name is derived from the sorted hashing of all object names.
/// This is only correct after the packfile has been written.
Pointer<git_oid> hash(Pointer<git_packbuilder> pb) {
return libgit2.git_packbuilder_hash(pb);
/// The packfile's name is derived from the packfile's content. This is only
/// correct after the packfile has been written.
String name(Pointer<git_packbuilder> pb) {
final result = libgit2.git_packbuilder_name(pb);
return result == nullptr ? '' : result.cast<Utf8>().toDartString();
}
/// Set number of threads to spawn.

View file

@ -447,6 +447,14 @@ class GitMergeFileFlag {
/// Take extra time to find minimal diff.
static const diffMinimal = GitMergeFileFlag._(128, 'diffMinimal');
/// Create zdiff3 ("zealous diff3")-style files.
static const styleZdiff3 = GitMergeFileFlag._(256, 'styleZdiff3');
/// Do not produce file conflicts when common regions have
/// changed; keep the conflict markers in the file and accept
/// that as the merge result.
static const acceptConflicts = GitMergeFileFlag._(512, 'acceptConflicts');
static const List<GitMergeFileFlag> values = [
defaults,
styleMerge,
@ -457,6 +465,8 @@ class GitMergeFileFlag {
ignoreWhitespaceEOL,
diffPatience,
diffMinimal,
styleZdiff3,
acceptConflicts,
];
int get value => _value;
@ -554,6 +564,10 @@ class GitCheckout {
/// notifications; don't update the working directory or index.
static const dryRun = GitCheckout._(16777216, 'dryRun');
/// Include common ancestor data in zdiff3 format for conflicts.
static const conflictStyleZdiff3 =
GitCheckout._(33554432, 'conflictStyleZdiff3');
static const List<GitCheckout> values = [
none,
safe,
@ -575,7 +589,8 @@ class GitCheckout {
conflictStyleDiff3,
dontRemoveExisting,
dontWriteIndex,
dryRun
dryRun,
conflictStyleZdiff3,
];
int get value => _value;

View file

@ -90,11 +90,11 @@ class PackBuilder {
/// Number of objects the packbuilder has already written out.
int get writtenLength => bindings.writtenCount(_packbuilderPointer);
/// Packfile's hash.
/// Unique name for the resulting packfile.
///
/// A packfile's name is derived from the sorted hashing of all object names.
/// This is only correct after the packfile has been written.
Oid get hash => Oid(bindings.hash(_packbuilderPointer));
/// The packfile's name is derived from the packfile's content. This is only
/// correct after the packfile has been written.
String get name => bindings.name(_packbuilderPointer);
/// Sets and returns the number of threads to spawn.
///

View file

@ -8,7 +8,7 @@ import 'package:libgit2dart/src/bindings/libgit2_bindings.dart';
import 'package:path/path.dart' as path;
import 'package:pub_cache/pub_cache.dart';
const libgit2Version = '1.3.0';
const libgit2Version = '1.4.0';
final libDir = path.join('.dart_tool', 'libgit2');
String getLibName() {