fix(update-test): guard the clone fallback's rm -rf against an empty path

This commit is contained in:
ethernet
2026-09-23 11:53:29 -04:00
parent 341c02a6ee
commit 2522c416ff

View File

@@ -182,7 +182,7 @@ clone_entry() {
case "$CLONE_MODE" in
clonefile) clonefile_entry "$1" "$2" || {
warn "fast clone of $(basename "$1") failed; cloning it file by file"
rm -rf "$2/$(basename "$1")"; cp -cpR "$1" "$2/"; } ;;
rm -rf "${2:?}/$(basename "$1")"; cp -cpR "$1" "$2/"; } ;;
reflink|copy-gnu) cp -a --reflink=auto "$1" "$2/" ;;
*) cp -pR "$1" "$2/" ;;
esac