]> Nutra Git (v1) - gamesguru/git-remote-gcrypt.git/commitdiff
try this #2
authorShane <chown_tee@proton.me>
Mon, 26 Jan 2026 06:33:52 +0000 (06:33 +0000)
committerShane <chown_tee@proton.me>
Mon, 26 Jan 2026 06:33:52 +0000 (06:33 +0000)
git-remote-gcrypt

index 5ea56f03a5a08b0f3646b86c9a05b5b7d1fc11e8..ae9564d6cd75110a685f2637ae45a45d32848c73 100755 (executable)
@@ -1539,12 +1539,29 @@ get_remote_file_list()
                        echo_info "Debug: Found refs: $refs"
                        for ref in $refs; do
                                echo_info "Debug: Checking ref $ref"
-                               ref_files=$(git -c core.quotePath=false ls-tree -r --name-only "$ref")
+                               # Verify object exists and is valid
+                               if ! git cat-file -e "$ref"; then
+                                       echo_info "Debug: Ref $ref points to missing object!"
+                                       continue
+                               fi
+
+                               local ls_stderr=""
+                               ls_stderr=$(mktemp)
+                               ref_files=$(git -c core.quotePath=false ls-tree -r --name-only "$ref" 2>"$ls_stderr") || {
+                                       echo_info "Debug: ls-tree failed for $ref:"
+                                       cat "$ls_stderr" >&2
+                                       rm -f "$ls_stderr"
+                                       continue
+                               }
+                               rm -f "$ls_stderr"
+
                                if isnonnull "$ref_files"; then
                                        # Map refs/gcrypt/list-files/BRANCH -> refs/heads/BRANCH
                                        local real_ref="refs/heads/${ref#refs/gcrypt/list-files/}"
                                        Global_Dirty_Refs="$Global_Dirty_Refs$real_ref "
                                        all_files="$all_files$ref_files$Newline"
+                               else
+                                       echo_info "Debug: Ref $ref is empty (no files found)."
                                fi
                        done