@@ -169,23 +169,19 @@ fn append_zip_entry<W: std::io::Write + std::io::Seek>(
169
169
. compression_level ( compression_level)
170
170
. large_file ( entry. bytes_remaining ( ) . map_or ( true , |len| len > u32:: MAX as usize ) )
171
171
. 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 } ) ;
177
173
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 => {
180
176
ar. start_file ( path. to_string ( ) , file_opts)
181
177
. map_err ( |err| std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , err) ) ?;
182
178
std:: io:: copy ( & mut entry, ar) ?;
183
179
}
184
- gix_object:: tree:: EntryMode :: Tree | gix_object:: tree:: EntryMode :: Commit => {
180
+ gix_object:: tree:: EntryKind :: Tree | gix_object:: tree:: EntryKind :: Commit => {
185
181
ar. add_directory ( path. to_string ( ) , file_opts)
186
182
. map_err ( |err| std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , err) ) ?;
187
183
}
188
- gix_object:: tree:: EntryMode :: Link => {
184
+ gix_object:: tree:: EntryKind :: Link => {
189
185
use bstr:: ByteSlice ;
190
186
std:: io:: copy ( & mut entry, buf) ?;
191
187
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>(
206
202
let mut header = tar:: Header :: new_gnu ( ) ;
207
203
header. set_mtime ( mtime_seconds_since_epoch as u64 ) ;
208
204
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 } ) ;
214
206
buf. clear ( ) ;
215
207
std:: io:: copy ( & mut entry, buf) ?;
216
208
217
209
let path = gix_path:: from_bstr ( add_prefix ( entry. relative_path ( ) , opts. tree_prefix . as_ref ( ) ) ) ;
218
210
header. set_size ( buf. len ( ) as u64 ) ;
219
211
220
- if entry. mode == gix_object :: tree :: EntryMode :: Link {
212
+ if entry. mode . is_link ( ) {
221
213
use bstr:: ByteSlice ;
222
214
let target = gix_path:: from_bstr ( buf. as_bstr ( ) ) ;
223
215
header. set_entry_type ( tar:: EntryType :: Symlink ) ;
@@ -231,13 +223,13 @@ fn append_tar_entry<W: std::io::Write>(
231
223
232
224
#[ cfg( any( feature = "tar" , feature = "tar_gz" ) ) ]
233
225
fn tar_entry_type ( mode : gix_object:: tree:: EntryMode ) -> tar:: EntryType {
234
- use gix_object:: tree:: EntryMode ;
226
+ use gix_object:: tree:: EntryKind ;
235
227
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 ,
241
233
}
242
234
}
243
235
0 commit comments