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
|
@ -56,18 +56,10 @@ Pointer<git_signature> now({required String name, required String email}) {
|
|||
///
|
||||
/// This looks up the user.name and user.email from the configuration and uses the
|
||||
/// current time as the timestamp, and creates a new signature based on that information.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Pointer<git_signature> defaultSignature(Pointer<git_repository> repo) {
|
||||
final out = calloc<Pointer<git_signature>>();
|
||||
final error = libgit2.git_signature_default(out, repo);
|
||||
|
||||
if (error < 0) {
|
||||
calloc.free(out);
|
||||
throw LibGit2Error(libgit2.git_error_last());
|
||||
} else {
|
||||
return out.value;
|
||||
}
|
||||
libgit2.git_signature_default(out, repo);
|
||||
return out.value;
|
||||
}
|
||||
|
||||
/// Free an existing signature.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue