]> Nutra Git (v2) - gamesguru/git-remote-gcrypt.git/commitdiff
clean URLs filtered specially for rsync:// protocol
authorShane Jaroch <chown_tee@proton.me>
Thu, 8 Jan 2026 23:34:28 +0000 (18:34 -0500)
committerShane Jaroch <chown_tee@proton.me>
Thu, 8 Jan 2026 23:34:28 +0000 (18:34 -0500)
git-remote-gcrypt

index 69c23cc380b529d0ff886b8f6852e55e165fe8d3..a667678a2b39afd878bf914e2c3433e3040ead69 100755 (executable)
@@ -1355,10 +1355,16 @@ elif [ "$NAME" = "gcrypt-clean" ]; then
        if ! ensure_connected; then
                echo_die "Could not connect to $URL."
        fi
-       
+
        # Get all files in the remote
-       remote_files=$(git ls-tree --name-only "$Gref" 2>/dev/null || :)
-       
+       # For rsync backends, list files directly via rsync --list-only (awk extracts filename).
+       # 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 '^\.$|^\.\.$' || :)
+       else
+               remote_files=$(git ls-tree --name-only "$Gref" 2>/dev/null || :)
+       fi
+
        if isnull "$remote_files"; then
                echo_info "Remote is empty. Nothing to clean."
                CLEAN_FINAL "$URL"