feat(reference): add ability to set target

This commit is contained in:
Aleksey Kulikov 2021-08-06 16:44:50 +03:00
parent 58fa54f24a
commit 371d52b7f8
5 changed files with 147 additions and 15 deletions

View file

@ -19,3 +19,9 @@ DynamicLibrary loadLibrary() {
}
final libgit2 = Libgit2(loadLibrary());
bool isValidShaHex(String str) {
final hexRegExp = RegExp(r'^[0-9a-fA-F]+$');
return hexRegExp.hasMatch(str) &&
(GIT_OID_MINPREFIXLEN <= str.length && GIT_OID_HEXSZ >= str.length);
}