mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
test: disable repository owner verification for tests (#47)
This commit is contained in:
parent
f42f8a6e1b
commit
94c40f9a94
4 changed files with 61 additions and 4 deletions
|
@ -2,6 +2,7 @@ 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/util.dart';
|
||||
|
||||
class Libgit2 {
|
||||
|
@ -33,4 +34,25 @@ class Libgit2 {
|
|||
.where((e) => featuresInt & e.value == e.value)
|
||||
.toSet();
|
||||
}
|
||||
|
||||
/// Returns owner validation setting for repository directories.
|
||||
static bool get ownerValidation {
|
||||
libgit2.git_libgit2_init();
|
||||
final out = calloc<Int8>();
|
||||
libgit2.git_libgit2_opts(
|
||||
git_libgit2_opt_t.GIT_OPT_GET_OWNER_VALIDATION,
|
||||
out,
|
||||
);
|
||||
return out.value == 1 || false;
|
||||
}
|
||||
|
||||
/// Sets owner validation setting for repository directories.
|
||||
static set ownerValidation(bool value) {
|
||||
libgit2.git_libgit2_init();
|
||||
final valueC = value ? 1 : 0;
|
||||
libgit2.git_libgit2_opts_set(
|
||||
git_libgit2_opt_t.GIT_OPT_SET_OWNER_VALIDATION,
|
||||
valueC,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue