File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -101,12 +101,15 @@ impl TryFrom<u32> for tree::EntryMode {
101
101
fn try_from ( mode : u32 ) -> Result < Self , Self :: Error > {
102
102
Ok ( match mode {
103
103
0o40000 => tree:: EntryMode :: Tree ,
104
- 0o100644 => tree:: EntryMode :: Blob ,
105
- 0o100755 => tree:: EntryMode :: BlobExecutable ,
106
104
0o120000 => tree:: EntryMode :: Link ,
107
105
0o160000 => tree:: EntryMode :: Commit ,
108
- 0o100664 => tree:: EntryMode :: Blob , // rare and found in the linux kernel
109
- 0o100640 => tree:: EntryMode :: Blob , // rare and found in the Rust repo
106
+ blob_mode if blob_mode & 0o100000 == 0o100000 => {
107
+ if blob_mode & 0o000100 == 0o000100 {
108
+ tree:: EntryMode :: BlobExecutable
109
+ } else {
110
+ tree:: EntryMode :: Blob
111
+ }
112
+ }
110
113
_ => return Err ( mode) ,
111
114
} )
112
115
}
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ mod from_bytes {
135
135
( "special-2" , 18 ) ,
136
136
( "special-3" , 5 ) ,
137
137
( "special-4" , 18 ) ,
138
+ ( "special-5" , 17 ) ,
138
139
] {
139
140
let fixture = fixture_name ( "tree" , & format ! ( "{name}.tree" ) ) ;
140
141
assert_eq ! (
You can’t perform that action at this time.
0 commit comments