From 9035e288d175a73485456f4f23a6395fe9f6ec2e Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Sun, 23 Jun 2019 21:13:36 -0400 Subject: Precise `tar_dir` behaviour --- src/archive.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/archive.rs') diff --git a/src/archive.rs b/src/archive.rs index f76d55c..268bb47 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -85,7 +85,26 @@ where /// Write a tarball of `dir` in `out`. /// /// The target directory will be saved as a top-level directory in the archive. -/// For example, if given `"a/b/c"`, it will be stored as just `"c"` in the archive. +/// +/// For example, consider this directory structure: +/// +/// ``` +/// a +/// └── b +/// └── c +/// ├── e +/// ├── f +/// └── g +/// ``` +/// +/// Making a tarball out of `"a/b/c"` will result in this archive content: +/// +/// ``` +/// c +/// ├── e +/// ├── f +/// └── g +/// ``` fn tar_dir(dir: &Path, skip_symlinks: bool, out: W) -> Result<(), ContextualError> where W: std::io::Write, -- cgit v1.2.3