-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3963 from felixhandte/also-handle-hidden-files-ou…
…tput-dir-mirror Remove Erroneous Exclusion of Hidden Files and Folders in `--output-dir-mirror`
- Loading branch information
Showing
4 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
# setup | ||
mkdir -p src/.hidden src/dir | ||
mkdir mid dst | ||
|
||
echo "file1" > src/file1 | ||
echo "file2" > src/.file2 | ||
echo "file3" > src/.hidden/.file3 | ||
echo "file4" > src/dir/.file4 | ||
|
||
# relative paths | ||
zstd -q -r --output-dir-mirror mid/ src/ | ||
zstd -q -d -r --output-dir-mirror dst/ mid/src/ | ||
|
||
diff --brief --recursive --new-file src/ dst/mid/src/ | ||
|
||
# reset | ||
rm -rf mid dst | ||
mkdir mid dst | ||
|
||
# from inside the directory | ||
(cd src; zstd -q -r --output-dir-mirror ../mid/ ./) | ||
(cd mid; zstd -q -d -r --output-dir-mirror ../dst/ ./) | ||
|
||
diff --brief --recursive --new-file src/ dst/ | ||
|
||
# reset | ||
rm -rf mid dst | ||
mkdir mid dst | ||
|
||
# absolute paths | ||
export BASE_PATH="$(pwd)" | ||
|
||
zstd -q -r --output-dir-mirror mid/ "${BASE_PATH}/src/" | ||
zstd -q -d -r --output-dir-mirror dst/ "${BASE_PATH}/mid/${BASE_PATH}/src/" | ||
|
||
diff --brief --recursive --new-file src/ "dst/${BASE_PATH}/mid/${BASE_PATH}/src/" | ||
|
||
# reset | ||
rm -rf mid dst | ||
mkdir mid dst | ||
|
||
# dots | ||
zstd -q -r --output-dir-mirror mid/ ./src/./ | ||
zstd -q -d -r --output-dir-mirror dst/ ./mid/./src/./ | ||
|
||
diff --brief --recursive --new-file src/ dst/mid/src/ |
Empty file.
Empty file.