The clean command is unstable and subject to deprecation or renaming and should not be used in scripts.
Supported backends for the clean command are ``rsync://``, ``rclone://``,
-and git-based remotes. The ``sftp://`` backend is not currently supported.
+``sftp://``, and git-based remotes.
If no URL or remote is specified, ``git-remote-gcrypt`` will list all
available ``gcrypt::`` remotes.
The clean command is unstable and subject to deprecation or renaming and should not be used in scripts.
Supported backends for the clean command are ``rsync://``, ``rclone://``,
-and git-based remotes. The ``sftp://`` backend is not currently supported.
+``sftp://``, and git-based remotes.
If no URL or remote is specified, ``git-remote-gcrypt`` will list all
available ``gcrypt::`` remotes.
# Get all files in the remote
# For rsync backends, list files directly via rsync --list-only (awk extracts filename).
# For rclone backends, list files via rclone lsf.
+ # For sftp backends, list files via curl directory listing.
# For git backends, list files from the gcrypt branch tree.
if isurl rsync "$URL"; then
remote_files=$(rsync --no-motd --list-only "$(rsynclocation "$URL")/" | awk '{print $NF}' | grep -vE '^\.$|^\.\.$' || :)
elif isurl rclone "$URL"; then
+ echo_info "WARNING: rclone clean support is experimental and may cause data loss."
remote_files=$(rclone lsf "$(rclonelocation "$URL")" 2>/dev/null || :)
+ elif isurl sftp "$URL"; then
+ echo_info "WARNING: sftp clean support is experimental and may cause data loss."
+ remote_files=$(curl -s -S -k "$URL/" 2>/dev/null | grep -vE '^\.$|^\.\.$' || :)
else
remote_files=$(git ls-tree --name-only "$Gref" 2>/dev/null || :)
fi