refactor!: return sets of git type flags instead of integers

This commit is contained in:
Aleksey Kulikov 2021-09-10 20:22:02 +03:00
parent 050c0eb57a
commit 7618f944c0
12 changed files with 459 additions and 191 deletions

View file

@ -208,7 +208,10 @@ class IndexEntry {
String get sha => _oidToHex(_indexEntryPointer.ref.id);
/// Returns the UNIX file attributes of a index entry.
GitFilemode get mode => intToGitFilemode(_indexEntryPointer.ref.mode);
GitFilemode get mode {
final modeInt = _indexEntryPointer.ref.mode;
return GitFilemode.values.singleWhere((mode) => modeInt == mode.value);
}
/// Sets the UNIX file attributes of a index entry.
set mode(GitFilemode mode) => _indexEntryPointer.ref.mode = mode.value;