mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
test: add more tests for throws and their messages
This commit is contained in:
parent
d6eae1e9ed
commit
127849519d
80 changed files with 2741 additions and 1501 deletions
|
@ -1,5 +1,4 @@
|
|||
import 'dart:ffi';
|
||||
import '../error.dart';
|
||||
import 'libgit2_bindings.dart';
|
||||
import '../util.dart';
|
||||
|
||||
|
@ -13,22 +12,11 @@ import '../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<git_repository> repoPointer,
|
||||
required Pointer<git_object> targetPointer,
|
||||
required int resetType,
|
||||
required Pointer<git_checkout_options> checkoutOptsPointer,
|
||||
}) {
|
||||
final error = libgit2.git_reset(
|
||||
repoPointer,
|
||||
targetPointer,
|
||||
resetType,
|
||||
checkoutOptsPointer,
|
||||
);
|
||||
|
||||
if (error < 0) {
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
}
|
||||
libgit2.git_reset(repoPointer, targetPointer, resetType, checkoutOptsPointer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue