We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
From<gix_object::tree::EntryKind> for entry::Mode
1 parent 668cb12 commit de4375aCopy full SHA for de4375a
gix-index/src/entry/mod.rs
@@ -107,9 +107,21 @@ mod access {
107
mod _impls {
108
use std::cmp::Ordering;
109
110
+ use crate::{entry, Entry, State};
111
use bstr::BStr;
-
112
- use crate::{Entry, State};
+ use gix_object::tree::EntryKind;
113
+
114
+ impl From<EntryKind> for entry::Mode {
115
+ fn from(value: EntryKind) -> Self {
116
+ match value {
117
+ EntryKind::Tree => entry::Mode::DIR,
118
+ EntryKind::Blob => entry::Mode::FILE,
119
+ EntryKind::BlobExecutable => entry::Mode::FILE_EXECUTABLE,
120
+ EntryKind::Link => entry::Mode::SYMLINK,
121
+ EntryKind::Commit => entry::Mode::COMMIT,
122
+ }
123
124
125
126
impl Entry {
127
/// Compare one entry to another by their path, by comparing only their common path portion byte by byte, then resorting to
0 commit comments