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 {
101101 fn try_from ( mode : u32 ) -> Result < Self , Self :: Error > {
102102 Ok ( match mode {
103103 0o40000 => tree:: EntryMode :: Tree ,
104- 0o100644 => tree:: EntryMode :: Blob ,
105- 0o100755 => tree:: EntryMode :: BlobExecutable ,
106104 0o120000 => tree:: EntryMode :: Link ,
107105 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+ }
110113 _ => return Err ( mode) ,
111114 } )
112115 }
Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ mod from_bytes {
135135 ( "special-2" , 18 ) ,
136136 ( "special-3" , 5 ) ,
137137 ( "special-4" , 18 ) ,
138+ ( "special-5" , 17 ) ,
138139 ] {
139140 let fixture = fixture_name ( "tree" , & format ! ( "{name}.tree" ) ) ;
140141 assert_eq ! (
You can’t perform that action at this time.
0 commit comments