@@ -169,23 +169,19 @@ fn append_zip_entry<W: std::io::Write + std::io::Seek>(
169169 . compression_level ( compression_level)
170170 . large_file ( entry. bytes_remaining ( ) . map_or ( true , |len| len > u32:: MAX as usize ) )
171171 . last_modified_time ( mtime)
172- . unix_permissions ( if matches ! ( entry. mode, gix_object:: tree:: EntryMode :: BlobExecutable ) {
173- 0o755
174- } else {
175- 0o644
176- } ) ;
172+ . unix_permissions ( if entry. mode . is_executable ( ) { 0o755 } else { 0o644 } ) ;
177173 let path = add_prefix ( entry. relative_path ( ) , tree_prefix) . into_owned ( ) ;
178- match entry. mode {
179- gix_object:: tree:: EntryMode :: Blob | gix_object:: tree:: EntryMode :: BlobExecutable => {
174+ match entry. mode . kind ( ) {
175+ gix_object:: tree:: EntryKind :: Blob | gix_object:: tree:: EntryKind :: BlobExecutable => {
180176 ar. start_file ( path. to_string ( ) , file_opts)
181177 . map_err ( |err| std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , err) ) ?;
182178 std:: io:: copy ( & mut entry, ar) ?;
183179 }
184- gix_object:: tree:: EntryMode :: Tree | gix_object:: tree:: EntryMode :: Commit => {
180+ gix_object:: tree:: EntryKind :: Tree | gix_object:: tree:: EntryKind :: Commit => {
185181 ar. add_directory ( path. to_string ( ) , file_opts)
186182 . map_err ( |err| std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , err) ) ?;
187183 }
188- gix_object:: tree:: EntryMode :: Link => {
184+ gix_object:: tree:: EntryKind :: Link => {
189185 use bstr:: ByteSlice ;
190186 std:: io:: copy ( & mut entry, buf) ?;
191187 ar. add_symlink ( path. to_string ( ) , buf. as_bstr ( ) . to_string ( ) , file_opts)
@@ -206,18 +202,14 @@ fn append_tar_entry<W: std::io::Write>(
206202 let mut header = tar:: Header :: new_gnu ( ) ;
207203 header. set_mtime ( mtime_seconds_since_epoch as u64 ) ;
208204 header. set_entry_type ( tar_entry_type ( entry. mode ) ) ;
209- header. set_mode ( if matches ! ( entry. mode, gix_object:: tree:: EntryMode :: BlobExecutable ) {
210- 0o755
211- } else {
212- 0o644
213- } ) ;
205+ header. set_mode ( if entry. mode . is_executable ( ) { 0o755 } else { 0o644 } ) ;
214206 buf. clear ( ) ;
215207 std:: io:: copy ( & mut entry, buf) ?;
216208
217209 let path = gix_path:: from_bstr ( add_prefix ( entry. relative_path ( ) , opts. tree_prefix . as_ref ( ) ) ) ;
218210 header. set_size ( buf. len ( ) as u64 ) ;
219211
220- if entry. mode == gix_object :: tree :: EntryMode :: Link {
212+ if entry. mode . is_link ( ) {
221213 use bstr:: ByteSlice ;
222214 let target = gix_path:: from_bstr ( buf. as_bstr ( ) ) ;
223215 header. set_entry_type ( tar:: EntryType :: Symlink ) ;
@@ -231,13 +223,13 @@ fn append_tar_entry<W: std::io::Write>(
231223
232224#[ cfg( any( feature = "tar" , feature = "tar_gz" ) ) ]
233225fn tar_entry_type ( mode : gix_object:: tree:: EntryMode ) -> tar:: EntryType {
234- use gix_object:: tree:: EntryMode ;
226+ use gix_object:: tree:: EntryKind ;
235227 use tar:: EntryType ;
236- match mode {
237- EntryMode :: Tree | EntryMode :: Commit => EntryType :: Directory ,
238- EntryMode :: Blob => EntryType :: Regular ,
239- EntryMode :: BlobExecutable => EntryType :: Regular ,
240- EntryMode :: Link => EntryType :: Link ,
228+ match mode. kind ( ) {
229+ EntryKind :: Tree | EntryKind :: Commit => EntryType :: Directory ,
230+ EntryKind :: Blob => EntryType :: Regular ,
231+ EntryKind :: BlobExecutable => EntryType :: Regular ,
232+ EntryKind :: Link => EntryType :: Link ,
241233 }
242234}
243235
0 commit comments