Skip to content

The error caused by failed push_negotiation is strange: "config value 'pack.windowMemory' was not found" #1042

@ilyagr

Description

@ilyagr

First of all, thank you so much for implementing this!

I'd like to be able to tell whether a push failure is caused by a failed push negotiation. However, the error currently returned by a push negotiation is very strange. For example, I added a simple dbg! to the provided test:

diff --git a/src/remote.rs b/src/remote.rs
index a15a095010...2a4816b245 100644
--- a/src/remote.rs
+++ b/src/remote.rs
@@ -1060,9 +1060,7 @@
             });
             let mut options = PushOptions::new();
             options.remote_callbacks(callbacks);
-            assert!(remote
-                .push(&["refs/heads/main"], Some(&mut options))
-                .is_err());
+            assert!(dbg!(remote.push(&["refs/heads/main"], Some(&mut options))).is_err());
         }
         assert!(updated);
         assert_eq!(remote_repo.branches(None).unwrap().count(), 0);

The dbg! shows that the error is the following unhelpful, and likely unintended, error:

[src/remote.rs:1063:21] remote.push(&["refs/heads/main"], Some(&mut options)) = Err(
    Error {
        code: -1,
        klass: 7,
        message: "config value 'pack.windowMemory' was not found",
    },
)

I'm not sure what it means.

This is at commit 04427a3. I'm on Apple Silicon Mac OS Sonoma 14.4.1:

$ rustc -Vv
rustc 1.79.0-nightly (4fd4797c2 2024-04-03)
binary: rustc
commit-hash: 4fd4797c2654977f545c9a91e2aa4e6cdbb38919
commit-date: 2024-04-03
host: aarch64-apple-darwin
release: 1.79.0-nightly
LLVM version: 18.1.2

$ uname -a
Darwin macaw.local 23.4.0 Darwin Kernel Version 23.4.0:
Fri Mar 15 00:12:49 PDT 2024;
root:xnu-10063.101.17~1/RELEASE_ARM64_T6020 arm64 arm Darwin

Cc: @karin0 @ehuss @samueltardieu #926

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions