File tree 3 files changed +8
-4
lines changed
gitoxide-core/src/repository
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,9 @@ fn format_from_ext(path: &Path) -> anyhow::Result<archive::Format> {
96
96
Ok ( match path. extension ( ) . and_then ( std:: ffi:: OsStr :: to_str) {
97
97
None => bail ! ( "Cannot derive archive format from a file without extension" ) ,
98
98
Some ( "tar" ) => archive:: Format :: Tar ,
99
- Some ( "gz" ) => archive:: Format :: TarGz ,
99
+ Some ( "gz" ) => archive:: Format :: TarGz {
100
+ compression_level : None ,
101
+ } ,
100
102
Some ( "zip" ) => archive:: Format :: Zip {
101
103
compression_level : None ,
102
104
} ,
Original file line number Diff line number Diff line change @@ -175,7 +175,9 @@ pub fn main() -> Result<()> {
175
175
gix:: worktree:: archive:: Format :: InternalTransientNonPersistable
176
176
}
177
177
crate :: plumbing:: options:: archive:: Format :: Tar => gix:: worktree:: archive:: Format :: Tar ,
178
- crate :: plumbing:: options:: archive:: Format :: TarGz => gix:: worktree:: archive:: Format :: TarGz ,
178
+ crate :: plumbing:: options:: archive:: Format :: TarGz => {
179
+ gix:: worktree:: archive:: Format :: TarGz { compression_level }
180
+ }
179
181
crate :: plumbing:: options:: archive:: Format :: Zip => {
180
182
gix:: worktree:: archive:: Format :: Zip { compression_level }
181
183
}
Original file line number Diff line number Diff line change @@ -159,8 +159,8 @@ pub mod archive {
159
159
/// Apply the prefix verbatim to any path we add to the archive. Use a trailing `/` if prefix is a directory.
160
160
#[ clap( long) ]
161
161
pub prefix : Option < String > ,
162
- /// The compression strength to use. Currently only used for `.zip` archives, valid from 0-9.
163
- #[ clap( long, short = 'l' , value_enum ) ]
162
+ /// The compression strength to use for `.zip` and `.tar.gz ` archives, valid from 0-9.
163
+ #[ clap( long, short = 'l' , requires = "format" ) ]
164
164
pub compression_level : Option < u8 > ,
165
165
/// Add the given path to the archive. Directories will always be empty.
166
166
#[ clap( long, short = 'p' ) ]
You can’t perform that action at this time.
0 commit comments