xfeed "$2" rclone delete -v --include-from=/dev/stdin "${1#rclone://}/" >&2
elif islocalrepo "$1"
then
- for fn_ in $2; do
+ echo "$2" | while IFS= read -r fn_; do
rm -f "$1"/"$fn_"
done
else
- for fn_ in $2; do
+ echo "$2" | while IFS= read -r fn_; do
gitception_remove "${1#gitception://}" "$fn_"
done
fi
if [ "${FORCE_INIT:-}" = "yes" ]; then
echo_info "WARNING: No gcrypt manifest found, but --init specified."
echo_info "WARNING: Proceeding to scan/clean potential unencrypted files."
+ elif isnull "$FORCE_CLEAN"; then
+ echo_info "WARNING: No gcrypt manifest found."
+ echo_info "WARNING: Listing all files as potential garbage (dry-run)."
else
- echo_die "Error: No gcrypt manifest found on remote '$URL'." \
- "Aborting clean to prevent accidental data loss."
+ echo_info "Error: No gcrypt manifest found on remote '$URL'."
+ echo_info "Aborting clean to prevent accidental data loss."
+ echo_info "To force initiation of the repository as git-crypt (and delete all old objects):"
+ echo_info " git-remote-gcrypt clean --init --force $URL"
+ exit 1
fi
fi
if isnull "$FORCE_CLEAN"; then
echo_info "NOTE: This is a scan of unencrypted files on the remote."
echo_info "To actually delete these files, use:"
- echo_info " git-remote-gcrypt clean $URL --force"
+ if [ "$Did_find_repo" != "yes" ]; then
+ echo_info " git-remote-gcrypt clean --init --force $URL"
+ else
+ echo_info " git-remote-gcrypt clean --force $URL"
+ fi
CLEAN_FINAL "$URL"
git remote remove "$NAME" 2>/dev/null || true
exit 0