mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-04 20:29:08 -04:00
refactor!: return sets of git type flags instead of integers
This commit is contained in:
parent
050c0eb57a
commit
7618f944c0
12 changed files with 459 additions and 191 deletions
|
@ -1,7 +1,6 @@
|
|||
import 'dart:io';
|
||||
import 'dart:ffi';
|
||||
import 'bindings/libgit2_bindings.dart';
|
||||
import 'git_types.dart';
|
||||
|
||||
DynamicLibrary loadLibrary() {
|
||||
if (Platform.isLinux || Platform.isAndroid || Platform.isFuchsia) {
|
||||
|
@ -26,22 +25,3 @@ bool isValidShaHex(String str) {
|
|||
return hexRegExp.hasMatch(str) &&
|
||||
(GIT_OID_MINPREFIXLEN <= str.length && GIT_OID_HEXSZ >= str.length);
|
||||
}
|
||||
|
||||
GitFilemode intToGitFilemode(int i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
return GitFilemode.unreadable;
|
||||
case 16384:
|
||||
return GitFilemode.tree;
|
||||
case 33188:
|
||||
return GitFilemode.blob;
|
||||
case 33261:
|
||||
return GitFilemode.blobExecutable;
|
||||
case 40960:
|
||||
return GitFilemode.link;
|
||||
case 57344:
|
||||
return GitFilemode.commit;
|
||||
default:
|
||||
return GitFilemode.unreadable;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue