Skip to content

Commit feba76d

Browse files
committed
adapt to changes in gix-archive
1 parent 088adad commit feba76d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: gitoxide-core/src/repository/archive.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ fn format_from_ext(path: &Path) -> anyhow::Result<archive::Format> {
9696
Ok(match path.extension().and_then(std::ffi::OsStr::to_str) {
9797
None => bail!("Cannot derive archive format from a file without extension"),
9898
Some("tar") => archive::Format::Tar,
99-
Some("gz") => archive::Format::TarGz,
99+
Some("gz") => archive::Format::TarGz {
100+
compression_level: None,
101+
},
100102
Some("zip") => archive::Format::Zip {
101103
compression_level: None,
102104
},

Diff for: src/plumbing/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ pub fn main() -> Result<()> {
175175
gix::worktree::archive::Format::InternalTransientNonPersistable
176176
}
177177
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+
}
179181
crate::plumbing::options::archive::Format::Zip => {
180182
gix::worktree::archive::Format::Zip { compression_level }
181183
}

Diff for: src/plumbing/options/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ pub mod archive {
159159
/// Apply the prefix verbatim to any path we add to the archive. Use a trailing `/` if prefix is a directory.
160160
#[clap(long)]
161161
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")]
164164
pub compression_level: Option<u8>,
165165
/// Add the given path to the archive. Directories will always be empty.
166166
#[clap(long, short = 'p')]

0 commit comments

Comments
 (0)