feat: upgrade libgit2 to 1.4.0

This commit is contained in:
Aleksey Kulikov 2022-02-16 13:25:22 +03:00
parent 7a067beeb9
commit bb433689cd
16 changed files with 705 additions and 253 deletions

View file

@ -105,7 +105,7 @@ void main() {
final callbacks = Callbacks(credentials: keypair);
final repo = Repository.clone(
url: 'https://github.com/libgit2/TestGitRepository',
url: 'ssh://git@github.com/libgit2/TestGitRepository',
localPath: cloneDir.path,
callbacks: callbacks,
);
@ -195,7 +195,7 @@ void main() {
final callbacks = Callbacks(credentials: keypair);
final repo = Repository.clone(
url: 'https://github.com/libgit2/TestGitRepository',
url: 'ssh://git@github.com/libgit2/TestGitRepository',
localPath: cloneDir.path,
callbacks: callbacks,
);

View file

@ -165,7 +165,7 @@ void main() {
group('GitMergeFileFlag', () {
test('returns correct values', () {
const expected = [0, 1, 2, 4, 8, 16, 32, 64, 128];
const expected = [0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512];
final actual = GitMergeFileFlag.values.map((e) => e.value).toList();
expect(actual, expected);
});
@ -202,6 +202,7 @@ void main() {
4194304,
8388608,
16777216,
33554432,
];
final actual = GitCheckout.values.map((e) => e.value).toList();
expect(actual, expected);

View file

@ -146,16 +146,16 @@ void main() {
packbuilder.free();
});
test('returns hash of packfile', () {
test('returns name of packfile', () {
final packbuilder = PackBuilder(repo);
final odb = repo.odb;
packbuilder.add(odb.objects[0]);
Directory(packDirPath).createSync();
expect(packbuilder.hash.sha, '0' * 40);
expect(packbuilder.name, isEmpty);
packbuilder.write(null);
expect(packbuilder.hash.sha, isNot('0' * 40));
expect(packbuilder.name, isNotEmpty);
packbuilder.free();
});