Commit 814b340c authored by Wayne Davison's avatar Wayne Davison

Improved the --delete-excluded test based on Matt's input and

another corner case I noticed.
parent f1678790
......@@ -23,15 +23,19 @@ checkit "$RSYNC -avv --remove-sent-files \
diff -r "$chkdir/empty" "$fromdir"
# Make sure that --delete-excluded does not dump a per-dir merge-file filter.
# Make sure that "P" but not "-" per-dir merge-file filters take effect with
# --delete-excluded.
cat >"$todir/filters" <<EOF
P foo
- bar
EOF
touch "$todir/foo"
touch "$todir/foo" "$todir/bar" "$todir/baz"
$RSYNC -r --filter=': filters' --delete-excluded "$fromdir/" "$todir/"
$RSYNC -r --exclude=baz --filter=': filters' --delete-excluded "$fromdir/" "$todir/"
test -f "$todir/foo" || test_fail "rsync incorrectly elided the merge file"
test -f "$todir/foo" || test_fail "rsync deleted $todir/foo"
test -f "$todir/bar" && test_fail "rsync did not delete $todir/bar"
test -f "$todir/baz" && test_fail "rsync did not delete $todir/baz"
# The script would have aborted on error, so getting here means we've won.
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment